diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 4413395..88b21a1 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -18,7 +18,6 @@ use Modules\ItemManagement\Models\Item; use Modules\ItemManagement\Models\ItemAttribute; use Modules\ItemManagement\Models\ItemAttributeMapper; use Modules\ItemManagement\Models\ItemAttributeType; -use phpOMS\Localization\BaseStringL11n; use Modules\ItemManagement\Models\ItemAttributeTypeL11nMapper; use Modules\ItemManagement\Models\ItemAttributeTypeMapper; use Modules\ItemManagement\Models\ItemAttributeValue; @@ -28,15 +27,16 @@ use Modules\ItemManagement\Models\ItemL11n; use Modules\ItemManagement\Models\ItemL11nMapper; use Modules\ItemManagement\Models\ItemL11nType; use Modules\ItemManagement\Models\ItemL11nTypeMapper; -use Modules\ItemManagement\Models\ItemRelationType; -use Modules\ItemManagement\Models\ItemRelationTypeMapper; use Modules\ItemManagement\Models\ItemMapper; use Modules\ItemManagement\Models\ItemPrice; use Modules\ItemManagement\Models\ItemPriceStatus; +use Modules\ItemManagement\Models\ItemRelationType; +use Modules\ItemManagement\Models\ItemRelationTypeMapper; use Modules\ItemManagement\Models\NullItemAttributeType; use Modules\ItemManagement\Models\NullItemAttributeValue; use Modules\ItemManagement\Models\NullItemL11nType; use Modules\Media\Models\PathSettings; +use phpOMS\Localization\BaseStringL11n; use phpOMS\Localization\ISO4217CharEnum; use phpOMS\Localization\ISO639x1Enum; use phpOMS\Localization\Money; @@ -104,7 +104,7 @@ final class ApiController extends Controller $item->purchasePrice = new Money($request->getData('purchaseprice', 'int') ?? 0); $item->info = (string) ($request->getData('info') ?? ''); $item->parent = ($request->getData('parent') !== null) ? (int) $request->getData('parent') : null; - $item->unit = ($request->getData('unit') !== null) ? (int) $request->getData('unit') : null; + $item->unit = ($request->getData('unit') !== null) ? (int) $request->getData('unit') : null; return $item; } @@ -327,7 +327,7 @@ final class ApiController extends Controller private function createItemAttributeTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n { $attrL11n = new BaseStringL11n(); - $attrL11n->ref = (int) ($request->getData('type') ?? 0); + $attrL11n->ref = (int) ($request->getData('type') ?? 0); $attrL11n->setLanguage((string) ( $request->getData('language') ?? $request->getLanguage() )); @@ -551,7 +551,7 @@ final class ApiController extends Controller private function createItemAttributeValueL11nFromRequest(RequestAbstract $request) : BaseStringL11n { $attrL11n = new BaseStringL11n(); - $attrL11n->ref = (int) ($request->getData('value') ?? 0); + $attrL11n->ref = (int) ($request->getData('value') ?? 0); $attrL11n->setLanguage((string) ( $request->getData('language') ?? $request->getLanguage() )); diff --git a/Models/ItemAttributeType.php b/Models/ItemAttributeType.php index 061dc98..ecc6cf8 100755 --- a/Models/ItemAttributeType.php +++ b/Models/ItemAttributeType.php @@ -14,8 +14,8 @@ declare(strict_types=1); namespace Modules\ItemManagement\Models; -use phpOMS\Localization\ISO639x1Enum; use phpOMS\Localization\BaseStringL11n; +use phpOMS\Localization\ISO639x1Enum; /** * Item Attribute Type class. @@ -121,7 +121,7 @@ class ItemAttributeType implements \JsonSerializable * Set l11n * * @param string|BaseStringL11n $l11n Tag article l11n - * @param string $lang Language + * @param string $lang Language * * @return void * @@ -134,7 +134,7 @@ class ItemAttributeType implements \JsonSerializable } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { $this->l11n->content = $l11n; } else { - $this->l11n = new BaseStringL11n(); + $this->l11n = new BaseStringL11n(); $this->l11n->content = $l11n; $this->l11n->setLanguage($lang); } diff --git a/Models/ItemAttributeTypeMapper.php b/Models/ItemAttributeTypeMapper.php index 3a2fc9d..e45f1cf 100755 --- a/Models/ItemAttributeTypeMapper.php +++ b/Models/ItemAttributeTypeMapper.php @@ -33,13 +33,13 @@ final class ItemAttributeTypeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'itemmgmt_attr_type_id' => ['name' => 'itemmgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'], - 'itemmgmt_attr_type_name' => ['name' => 'itemmgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + 'itemmgmt_attr_type_id' => ['name' => 'itemmgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'], + 'itemmgmt_attr_type_name' => ['name' => 'itemmgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], 'itemmgmt_attr_type_datatype' => ['name' => 'itemmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], - 'itemmgmt_attr_type_fields' => ['name' => 'itemmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], - 'itemmgmt_attr_type_custom' => ['name' => 'itemmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'itemmgmt_attr_type_pattern' => ['name' => 'itemmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], - 'itemmgmt_attr_type_required' => ['name' => 'itemmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], + 'itemmgmt_attr_type_fields' => ['name' => 'itemmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], + 'itemmgmt_attr_type_custom' => ['name' => 'itemmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], + 'itemmgmt_attr_type_pattern' => ['name' => 'itemmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], + 'itemmgmt_attr_type_required' => ['name' => 'itemmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], ]; /** diff --git a/Models/ItemAttributeValue.php b/Models/ItemAttributeValue.php index e39f382..305400a 100755 --- a/Models/ItemAttributeValue.php +++ b/Models/ItemAttributeValue.php @@ -14,8 +14,8 @@ declare(strict_types=1); namespace Modules\ItemManagement\Models; -use phpOMS\Localization\ISO639x1Enum; use phpOMS\Localization\BaseStringL11n; +use phpOMS\Localization\ISO639x1Enum; /** * Item attribute value class. @@ -124,7 +124,7 @@ class ItemAttributeValue implements \JsonSerializable * Set l11n * * @param string|BaseStringL11n $l11n Tag article l11n - * @param string $lang Language + * @param string $lang Language * * @return void * @@ -137,9 +137,9 @@ class ItemAttributeValue implements \JsonSerializable } elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) { $this->l11n->content = $l11n; } else { - $this->l11n = new BaseStringL11n(); + $this->l11n = new BaseStringL11n(); $this->l11n->content = $l11n; - $this->l11n->ref = $this->id; + $this->l11n->ref = $this->id; $this->l11n->setLanguage($lang); } } @@ -160,7 +160,7 @@ class ItemAttributeValue implements \JsonSerializable * Set value * * @param int|string|float|\DateTimeInterface $value Value - * @param int $type Datatype + * @param int $type Datatype * * @return void * diff --git a/Models/ItemMapper.php b/Models/ItemMapper.php index b66fe18..829cd14 100755 --- a/Models/ItemMapper.php +++ b/Models/ItemMapper.php @@ -42,7 +42,7 @@ final class ItemMapper extends DataMapperFactory 'itemmgmt_item_salesprice' => ['name' => 'itemmgmt_item_salesprice', 'type' => 'Serializable', 'internal' => 'salesPrice'], 'itemmgmt_item_purchaseprice' => ['name' => 'itemmgmt_item_purchaseprice', 'type' => 'Serializable', 'internal' => 'purchasePrice'], 'itemmgmt_item_parent' => ['name' => 'itemmgmt_item_parent', 'type' => 'int', 'internal' => 'parent'], - 'itemmgmt_item_unit' => ['name' => 'itemmgmt_item_unit', 'type' => 'int', 'internal' => 'unit'], + 'itemmgmt_item_unit' => ['name' => 'itemmgmt_item_unit', 'type' => 'int', 'internal' => 'unit'], ]; /** diff --git a/Models/ItemRelation.php b/Models/ItemRelation.php index bce33c6..9baa8e5 100644 --- a/Models/ItemRelation.php +++ b/Models/ItemRelation.php @@ -74,10 +74,10 @@ class ItemRelation implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'source' => $this->source, + 'id' => $this->id, + 'source' => $this->source, 'destination' => $this->destination, - 'type' => $this->type, + 'type' => $this->type, ]; } diff --git a/Models/ItemRelationMapper.php b/Models/ItemRelationMapper.php index 536a6a2..b6c64f2 100644 --- a/Models/ItemRelationMapper.php +++ b/Models/ItemRelationMapper.php @@ -34,9 +34,9 @@ final class ItemRelationMapper extends DataMapperFactory */ public const COLUMNS = [ 'itemmgmt_item_relation_id' => ['name' => 'itemmgmt_item_relation_id', 'type' => 'int', 'internal' => 'id'], - 'itemmgmt_item_relation_src' => ['name' => 'itemmgmt_item_relation_src', 'type' => 'int', 'internal' => 'source'], - 'itemmgmt_item_relation_dst' => ['name' => 'itemmgmt_item_relation_dst', 'type' => 'int', 'internal' => 'destination'], - 'itemmgmt_item_relation_type' => ['name' => 'itemmgmt_item_relation_type', 'type' => 'int', 'internal' => 'type'], + 'itemmgmt_item_relation_src' => ['name' => 'itemmgmt_item_relation_src', 'type' => 'int', 'internal' => 'source'], + 'itemmgmt_item_relation_dst' => ['name' => 'itemmgmt_item_relation_dst', 'type' => 'int', 'internal' => 'destination'], + 'itemmgmt_item_relation_type' => ['name' => 'itemmgmt_item_relation_type', 'type' => 'int', 'internal' => 'type'], ]; /** diff --git a/tests/Models/ItemAttributeValueTest.php b/tests/Models/ItemAttributeValueTest.php index 573ed3f..2b65d55 100755 --- a/tests/Models/ItemAttributeValueTest.php +++ b/tests/Models/ItemAttributeValueTest.php @@ -14,8 +14,8 @@ declare(strict_types=1); namespace Modules\ItemManagement\tests\Models; -use Modules\ItemManagement\Models\ItemAttributeValue; use Modules\ItemManagement\Models\AttributeValueType; +use Modules\ItemManagement\Models\ItemAttributeValue; /** * @internal