From d9aefacf083b28733a6f19efa6242211fd44c675 Mon Sep 17 00:00:00 2001 From: Thomas Kreidenhuber Date: Sun, 21 May 2017 12:55:59 +0200 Subject: [PATCH] magento-engcom/magento2#25 made changes from codereview in pull request --- .../Model/Resource/Source/Collection.php | 8 - app/code/Magento/Inventory/Model/Source.php | 11 +- .../Inventory/Model/SourceCarrierLink.php | 8 - .../Inventory/Model/SourceRepository.php | 41 +- .../Inventory/Model/SourceSearchResults.php | 4 - .../Magento/Inventory/Setup/InstallSchema.php | 365 ++++++++++-------- .../Test/Unit/Model/SourceCarrierLinkTest.php | 7 +- .../Test/Unit/Model/SourceRepositoryTest.php | 1 - .../Inventory/Test/Unit/Model/SourceTest.php | 7 +- .../InventoryApi/Api/Data/SourceInterface.php | 2 +- .../Api/SourceRepositoryInterface.php | 2 +- 11 files changed, 255 insertions(+), 201 deletions(-) diff --git a/app/code/Magento/Inventory/Model/Resource/Source/Collection.php b/app/code/Magento/Inventory/Model/Resource/Source/Collection.php index 4c9069289549..d149d175115e 100644 --- a/app/code/Magento/Inventory/Model/Resource/Source/Collection.php +++ b/app/code/Magento/Inventory/Model/Resource/Source/Collection.php @@ -19,12 +19,4 @@ protected function _construct() { $this->_init(SourceModel::class, ResourceSource::class); } - - /** - * @inheritdoc - */ - public function getIdFieldName() - { - return SourceInterface::SOURCE_ID; - } } diff --git a/app/code/Magento/Inventory/Model/Source.php b/app/code/Magento/Inventory/Model/Source.php index c7226302e786..b027936da91c 100644 --- a/app/code/Magento/Inventory/Model/Source.php +++ b/app/code/Magento/Inventory/Model/Source.php @@ -10,16 +10,13 @@ use \Magento\InventoryApi\Api\Data\SourceInterface; /** - * Class Source - * @package Magento\Inventory\Model + * Class Source, + * provides implementation of the SourceInterface which adds the possibilty + * for a Merchant to map existing physical sources to some particular sales channels + * this model holds the information like name and description of this physical sources */ class Source extends AbstractExtensibleModel implements SourceInterface { - /** - * @inheritdoc - */ - protected $_collectionName = \Magento\Inventory\Model\Resource\Source\Collection::class; - /** * @inheritdoc */ diff --git a/app/code/Magento/Inventory/Model/SourceCarrierLink.php b/app/code/Magento/Inventory/Model/SourceCarrierLink.php index 5a7606340f25..2b5473103521 100644 --- a/app/code/Magento/Inventory/Model/SourceCarrierLink.php +++ b/app/code/Magento/Inventory/Model/SourceCarrierLink.php @@ -11,14 +11,6 @@ class SourceCarrierLink extends AbstractExtensibleModel implements SourceCarrierLinkInterface { - /** - * Name of the resource collection model - * - * @codingStandardsIgnore - * @var string - */ - protected $_collectionName = \Magento\Inventory\Model\Resource\SourceCarrierLink\Collection::class; - /** * Initialize resource model * diff --git a/app/code/Magento/Inventory/Model/SourceRepository.php b/app/code/Magento/Inventory/Model/SourceRepository.php index 607b202d4c29..27bef7ff5584 100644 --- a/app/code/Magento/Inventory/Model/SourceRepository.php +++ b/app/code/Magento/Inventory/Model/SourceRepository.php @@ -17,11 +17,14 @@ use Magento\Inventory\Model\SourceSearchResultsFactory; use Magento\Inventory\Model\Resource\Source as ResourceSource; use Magento\Inventory\Model\Resource\Source\CollectionFactory; -use Magento\Inventory\Model\SourceFactory; +use Magento\Inventory\Model\SourceFactoryInterface; +use \Psr\Log\LoggerInterface; /** * Class SourceRepository - * @package Magento\Inventory\Model + * + * Provides implementation of CQRS for sourcemodel + * */ class SourceRepository implements SourceRepositoryInterface { @@ -31,7 +34,7 @@ class SourceRepository implements SourceRepositoryInterface private $resource; /** - * @var SourceFactory + * @var SourceFactoryInterface */ private $sourceFactory; @@ -50,26 +53,34 @@ class SourceRepository implements SourceRepositoryInterface */ private $sourceSearchResultsFactory; + /** + * @var LoggerInterface + */ + private $logger; + /** * SourceRepository constructor. * @param ResourceSource $resource - * @param SourceFactory $sourceFactory + * @param SourceFactoryInterface $sourceFactory * @param CollectionProcessorInterface $collectionProcessor * @param CollectionFactory $collectionFactory * @param SourceSearchResultsFactory $sourceSearchResultsFactory + * @param LoggerInterface $logger */ public function __construct( ResourceSource $resource, - SourceFactory $sourceFactory, + SourceFactoryInterface $sourceFactory, CollectionProcessorInterface $collectionProcessor, CollectionFactory $collectionFactory, - SourceSearchResultsFactory $sourceSearchResultsFactory + SourceSearchResultsFactory $sourceSearchResultsFactory, + LoggerInterface $logger ) { $this->resource = $resource; $this->sourceFactory = $sourceFactory; $this->collectionProcessor = $collectionProcessor; $this->collectionFactory = $collectionFactory; $this->sourceSearchResultsFactory = $sourceSearchResultsFactory; + $this->logger = $logger; } /** @@ -80,9 +91,9 @@ public function save(SourceInterface $source) try { $this->resource->save($source); } catch (\Exception $exception) { - throw new CouldNotSaveException(__($exception->getMessage())); + $this->logger->error($exception->getMessage()); + throw new CouldNotSaveException(__('Could not save source')); } - return $source; } /** @@ -91,14 +102,14 @@ public function save(SourceInterface $source) public function get($sourceId) { /** @var SourceInterface|AbstractModel $model */ - $model = $this->sourceFactory->create(); - $this->resource->load($model, SourceInterface::SOURCE_ID, $sourceId); + $source = $this->sourceFactory->create(); + $this->resource->load($source, SourceInterface::SOURCE_ID, $sourceId); - if (!$model->getSourceId()) { + if (!$source->getSourceId()) { throw NoSuchEntityException::singleField(SourceInterface::SOURCE_ID, $sourceId); } - return $model; + return $source; } /** @@ -108,7 +119,11 @@ public function getList(SearchCriteriaInterface $searchCriteria = null) { /** @var \Magento\Inventory\Model\Resource\Source\Collection $collection */ $collection = $this->collectionFactory->create(); - $this->collectionProcessor->process($searchCriteria, $collection); + + // if there is a searchCriteria defined, use it to add its creterias to the collection + if (!is_null($searchCriteria)) { + $this->collectionProcessor->process($searchCriteria, $collection); + } /** @var SourceSearchResultsInterface $searchResults */ $searchResults = $this->sourceSearchResultsFactory->create(); diff --git a/app/code/Magento/Inventory/Model/SourceSearchResults.php b/app/code/Magento/Inventory/Model/SourceSearchResults.php index 685ed663b25c..e41ad207c8e4 100644 --- a/app/code/Magento/Inventory/Model/SourceSearchResults.php +++ b/app/code/Magento/Inventory/Model/SourceSearchResults.php @@ -8,10 +8,6 @@ use Magento\Framework\Api\SearchResults; use Magento\InventoryApi\Api\Data\SourceSearchResultsInterface; -/** - * Class SourceSearchResults - * @package Magento\Inventory\Model - */ class SourceSearchResults extends SearchResults implements SourceSearchResultsInterface { diff --git a/app/code/Magento/Inventory/Setup/InstallSchema.php b/app/code/Magento/Inventory/Setup/InstallSchema.php index 18636d89597f..ae8a3c878d28 100644 --- a/app/code/Magento/Inventory/Setup/InstallSchema.php +++ b/app/code/Magento/Inventory/Setup/InstallSchema.php @@ -7,20 +7,25 @@ use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\InventoryApi\Api\Data\SourceInterface; +use Magento\InventoryApi\Api\Data\SourceCarrierLinkInterface; -/** - * Class InstallSchema - * @package Magento\Inventory\Setup - */ class InstallSchema implements InstallSchemaInterface { /** - * + * Constant for table names of the model \Magento\Inventory\Model\Source */ const TABLE_NAME_SOURCE = 'inventory_source'; + + /** + * Constant for table name of \Magento\Inventory\Model\SourceCarrierLink + */ const TABLE_NAME_SOURCE_CARRIER_LINK = 'inventory_source_carrier_link'; + /** + * Constant for decimal precision for latitude and longitude + */ + const DECIMAL_PLACES = 8; /** * Option keys for column options @@ -32,8 +37,12 @@ class InstallSchema implements InstallSchemaInterface const OPTION_DEFAULT = 'default'; const OPTION_TYPE = 'type'; const OPTION_LENGTH = 'length'; + const OPTION_SCALE = 'scale'; + const OPTION_PRECISION = 'precision'; /** + * Generates needed database structure for source and sourcecarrierlink implementation from this module + * * @param SchemaSetupInterface $setup * @param ModuleContextInterface $context */ @@ -44,123 +53,165 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $tableNameSourceEntity = $installer->getTable(InstallSchema::TABLE_NAME_SOURCE); if (!$installer->getConnection()->isTableExists($tableNameSourceEntity)) { - $table = $installer->getConnection()->newTable($tableNameSourceEntity); - $options = [ - InstallSchema::OPTION_IDENTITY => true, - InstallSchema::OPTION_UNSIGNED => true, - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_PRIMARY => true - ]; - $table->addColumn(SourceInterface::SOURCE_ID, Table::TYPE_INTEGER, null, $options, 'Source ID'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::NAME, Table::TYPE_TEXT, 255, $options, 'Source Name'); - - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::CONTACT_NAME, Table::TYPE_TEXT, 255, $options, 'Contact Name'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::EMAIL, Table::TYPE_TEXT, 255, $options, 'Email'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_UNSIGNED => true, - InstallSchema::OPTION_DEFAULT => 1 - ]; - $table->addColumn(SourceInterface::IS_ACTIVE, - Table::TYPE_SMALLINT, + $table->addColumn( + SourceInterface::SOURCE_ID, + Table::TYPE_INTEGER, null, - $options, - 'Defines Is Source Active'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::DESCRIPTION, Table::TYPE_TEXT, 255, $options, 'Description'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::LATITUDE, Table::TYPE_TEXT, 255, $options, 'Latitude'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::LONGITUDE, Table::TYPE_TEXT, 255, $options, 'Longitude'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_UNSIGNED => true - ]; - - $table->addColumn(SourceInterface::COUNTRY_ID, Table::TYPE_SMALLINT, null, $options, 'Country Id'); - - $options = [ - InstallSchema::OPTION_NULLABLE => true, - InstallSchema::OPTION_UNSIGNED => true - ]; - - $table->addColumn(SourceInterface::REGION_ID, Table::TYPE_SMALLINT, null, $options, 'Region Id'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::REGION, Table::TYPE_TEXT, 255, $options, 'Region'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::CITY, Table::TYPE_TEXT, 255, $options, 'City'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::STREET, Table::TYPE_TEXT, 255, $options, 'Street'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::POSTCODE, Table::TYPE_TEXT, 255, $options, 'Postcode'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::PHONE, Table::TYPE_TEXT, 255, $options, 'Phone'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn(SourceInterface::FAX, Table::TYPE_TEXT, 255, $options, 'Fax'); - - $options = [ - InstallSchema::OPTION_NULLABLE => true, - InstallSchema::OPTION_UNSIGNED => true, - ]; - - $table->addColumn(SourceInterface::PRIORITY, Table::TYPE_SMALLINT, null, $options, 'Priority'); - - + [ + InstallSchema::OPTION_IDENTITY => true, + InstallSchema::OPTION_UNSIGNED => true, + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_PRIMARY => true + ], + 'Source ID' + ) + ->addColumn( + SourceInterface::NAME, + Table::TYPE_TEXT, + 255, [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], + 'Source Name' + ) + ->addColumn( + SourceInterface::CONTACT_NAME, + Table::TYPE_TEXT, + 255, [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], + 'Contact Name' + ) + ->addColumn( + SourceInterface::EMAIL, + Table::TYPE_TEXT, + 255, [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], + 'Email' + ) + ->addColumn( + SourceInterface::IS_ACTIVE, + Table::TYPE_SMALLINT, + null, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_UNSIGNED => true, + InstallSchema::OPTION_DEFAULT => 1 + ], + 'Defines Is Source Active' + ) + ->addColumn( + SourceInterface::DESCRIPTION, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], + 'Description' + ) + ->addColumn( + SourceInterface::LATITUDE, + Table::TYPE_DECIMAL, null, + [ + InstallSchema::OPTION_PRECISION => InstallSchema::DECIMAL_PLACES, + InstallSchema::OPTION_SCALE => InstallSchema::DECIMAL_PLACES, + InstallSchema::OPTION_NULLABLE => true + ], 'Latitude' + ) + ->addColumn( + SourceInterface::LONGITUDE, + Table::TYPE_DECIMAL, null, + [ + InstallSchema::OPTION_PRECISION => InstallSchema::DECIMAL_PLACES, + InstallSchema::OPTION_SCALE => InstallSchema::DECIMAL_PLACES, + InstallSchema::OPTION_NULLABLE => true + ], 'Longitude' + ) + ->addColumn( + SourceInterface::COUNTRY_ID, + Table::TYPE_SMALLINT, + null, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_UNSIGNED => true + ], 'Country Id' + )->addColumn( + SourceInterface::REGION_ID, + Table::TYPE_SMALLINT, + null, + [ + InstallSchema::OPTION_NULLABLE => true, + InstallSchema::OPTION_UNSIGNED => true + ], 'Region Id' + )->addColumn( + SourceInterface::REGION, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Region' + ) + ->addColumn( + SourceInterface::CITY, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'City' + ) + ->addColumn( + SourceInterface::STREET, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Street' + ) + ->addColumn( + SourceInterface::POSTCODE, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Postcode' + ) + ->addColumn( + SourceInterface::PHONE, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Phone' + ) + ->addColumn( + SourceInterface::FAX, + Table::TYPE_TEXT, + 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Fax' + ) + ->addColumn( + SourceInterface::PRIORITY, + Table::TYPE_SMALLINT, + null, + [ + InstallSchema::OPTION_NULLABLE => true, + InstallSchema::OPTION_UNSIGNED => true, + ], 'Priority' + ); $table->setComment('Inventory Source Entity Table')->setOption('type', 'InnoDB')->setOption('charset', 'utf8'); $installer->getConnection()->createTable($table); @@ -170,38 +221,43 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con if (!$installer->getConnection()->isTableExists($tableNameCarrierLinkEntity)) { $table = $installer->getConnection()->newTable($tableNameCarrierLinkEntity); - - $options = [ - InstallSchema::OPTION_IDENTITY => true, - InstallSchema::OPTION_UNSIGNED => true, - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_PRIMARY => true - ]; - $table->addColumn('source_carrier_link_id', - Table::TYPE_INTEGER, - null, - $options, - 'Source Carrier Link ID' - ); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_UNSIGNED => true, - ]; - $table->addColumn(SourceInterface::SOURCE_ID, Table::TYPE_INTEGER, null, $options, 'Source ID'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_DEFAULT => '' - ]; - $table->addColumn('carrier_code', Table::TYPE_TEXT, 255, $options, 'Carrier Code'); - - $options = [ - InstallSchema::OPTION_NULLABLE => false, - InstallSchema::OPTION_UNSIGNED => true, - ]; - - $table->addColumn('position', Table::TYPE_SMALLINT, null, $options, 'Position'); + $table->addColumn( + 'source_carrier_link_id', + Table::TYPE_INTEGER, + null, + [ + InstallSchema::OPTION_IDENTITY => true, + InstallSchema::OPTION_UNSIGNED => true, + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_PRIMARY => true + ], + 'Source Carrier Link ID' + ) + ->addColumn( + SourceInterface::SOURCE_ID, + Table::TYPE_INTEGER, null, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_UNSIGNED => true, + ], 'Source ID' + ) + ->addColumn( + SourceCarrierLinkInterface::CARRIER_CODE, + Table::TYPE_TEXT, 255, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_DEFAULT => '' + ], 'Carrier Code' + ) + ->addColumn( + 'position', Table::TYPE_SMALLINT, + null, + [ + InstallSchema::OPTION_NULLABLE => false, + InstallSchema::OPTION_UNSIGNED => true, + ], + 'Position' + ); // Add foreign key for Pipeline ID field $foreignKeyName = $installer->getConnection()->getForeignKeyName( @@ -218,11 +274,12 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con Table::ACTION_CASCADE ); - $table->setComment('Inventory Source Carrier Link Entity Table')->setOption('type', 'InnoDB')->setOption('charset', - 'utf8'); + $table->setComment('Inventory Source Carrier Link Entity Table')->setOption('type', 'InnoDB')->setOption( + 'charset', + 'utf8' + ); $installer->getConnection()->createTable($table); } - $setup->endSetup(); } } diff --git a/app/code/Magento/Inventory/Test/Unit/Model/SourceCarrierLinkTest.php b/app/code/Magento/Inventory/Test/Unit/Model/SourceCarrierLinkTest.php index fe6ff139cbc1..259eee69c31a 100644 --- a/app/code/Magento/Inventory/Test/Unit/Model/SourceCarrierLinkTest.php +++ b/app/code/Magento/Inventory/Test/Unit/Model/SourceCarrierLinkTest.php @@ -8,6 +8,9 @@ use \Magento\Inventory\Model\SourceCarrierLink; +/** + * Class SourceCarrierLinkTest + */ class SourceCarrierLinkTest extends \PHPUnit_Framework_TestCase { /** @@ -19,12 +22,12 @@ class SourceCarrierLinkTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ - protected $objectManager; + private $objectManager; /** * @var SourceCarrierLink */ - protected $sourceCarrierLink; + private $sourceCarrierLink; protected function setUp() { diff --git a/app/code/Magento/Inventory/Test/Unit/Model/SourceRepositoryTest.php b/app/code/Magento/Inventory/Test/Unit/Model/SourceRepositoryTest.php index 3e06272ef728..0caa923e7b88 100644 --- a/app/code/Magento/Inventory/Test/Unit/Model/SourceRepositoryTest.php +++ b/app/code/Magento/Inventory/Test/Unit/Model/SourceRepositoryTest.php @@ -10,7 +10,6 @@ /** * Class SourceRepositoryTest - * @package Magento\Inventory\Test\Unit\Model */ class SourceRepositoryTest extends \PHPUnit_Framework_TestCase { diff --git a/app/code/Magento/Inventory/Test/Unit/Model/SourceTest.php b/app/code/Magento/Inventory/Test/Unit/Model/SourceTest.php index 252cb6c309d0..f78c2e66d934 100644 --- a/app/code/Magento/Inventory/Test/Unit/Model/SourceTest.php +++ b/app/code/Magento/Inventory/Test/Unit/Model/SourceTest.php @@ -8,6 +8,9 @@ use \Magento\Inventory\Model\Source; +/** + * Class SourceTest + */ class SourceTest extends \PHPUnit_Framework_TestCase { /** @@ -20,12 +23,12 @@ class SourceTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ - protected $objectManager; + private $objectManager; /** * @var Source */ - protected $source; + private $source; protected function setUp() { diff --git a/app/code/Magento/InventoryApi/Api/Data/SourceInterface.php b/app/code/Magento/InventoryApi/Api/Data/SourceInterface.php index 70cef91a7dd0..75ac289b5f24 100644 --- a/app/code/Magento/InventoryApi/Api/Data/SourceInterface.php +++ b/app/code/Magento/InventoryApi/Api/Data/SourceInterface.php @@ -165,7 +165,7 @@ public function getCountryId(); /** * Set source country id. * - * @param string $countryId + * @param int $countryId * @return $this */ public function setCountryId($countryId); diff --git a/app/code/Magento/InventoryApi/Api/SourceRepositoryInterface.php b/app/code/Magento/InventoryApi/Api/SourceRepositoryInterface.php index 7859e32297fb..ffd97d5837a1 100644 --- a/app/code/Magento/InventoryApi/Api/SourceRepositoryInterface.php +++ b/app/code/Magento/InventoryApi/Api/SourceRepositoryInterface.php @@ -20,7 +20,7 @@ interface SourceRepositoryInterface * Save Source data. * * @param SourceInterface $source - * @return SourceInterface + * @return void * * @throws CouldNotSaveException */