From 18725b81b06e349da6e12073350707d05175929c Mon Sep 17 00:00:00 2001 From: Henri Nijborg Date: Fri, 28 Feb 2020 17:13:33 +0100 Subject: [PATCH] Use full paths due to dependency injection --- Api/Data/OrderStateInterface.php | 4 +- Api/Data/OrderStatusInterface.php | 4 +- Api/Data/PaymentCostInterface.php | 10 +-- Api/Data/PaymentMethodInterface.php | 4 +- Api/Data/PriceListInterface.php | 12 +-- Api/Data/PriceListItemInterface.php | 16 ++-- .../PriceListItemSearchResultsInterface.php | 10 +-- Api/Data/PriceListSearchResultsInterface.php | 10 +-- Api/Data/ShippingMethodInterface.php | 4 +- Api/Data/VersionInterface.php | 6 +- Api/OrderStateRepositoryInterface.php | 4 +- Api/OrderStatusRepositoryInterface.php | 4 +- Api/PaymentMethodRepositoryInterface.php | 4 +- Api/PriceListItemRepositoryInterface.php | 36 ++++---- Api/PriceListRepositoryInterface.php | 48 +++++------ Api/RestManagementInterface.php | 4 +- Api/ShippingMethodRepositoryInterface.php | 4 +- Model/AlterShipment.php | 12 +-- Model/Customer/Attribute/Source/VatClass.php | 4 +- Model/OrderState.php | 4 +- Model/OrderStateRepository.php | 7 +- Model/OrderStatus.php | 4 +- Model/OrderStatusRepository.php | 7 +- Model/PaymentCost.php | 5 +- Model/PaymentMethod.php | 4 +- Model/PaymentMethodRepository.php | 11 +-- Model/PriceList.php | 8 +- .../PriceList/Attribute/Source/PriceList.php | 17 ++-- Model/PriceListItem.php | 5 +- Model/PriceListItemRepository.php | 63 +++++--------- Model/PriceListRepository.php | 85 +++++++------------ Model/ResourceModel/PriceList.php | 4 +- Model/ResourceModel/PriceList/Collection.php | 7 +- Model/ResourceModel/PriceListItem.php | 4 +- .../PriceListItem/Collection.php | 7 +- Model/RestManagement.php | 10 +-- Model/ShippingMethod.php | 4 +- Model/ShippingMethodRepository.php | 11 +-- Model/Version.php | 4 +- 39 files changed, 175 insertions(+), 296 deletions(-) diff --git a/Api/Data/OrderStateInterface.php b/Api/Data/OrderStateInterface.php index 7a3e130..500a84b 100644 --- a/Api/Data/OrderStateInterface.php +++ b/Api/Data/OrderStateInterface.php @@ -11,7 +11,7 @@ public function getCode(); /** * @param string $code - * @return OrderStateInterface + * @return \Dealer4dealer\Xcore\Api\Data\OrderStateInterface */ public function setCode($code); @@ -22,7 +22,7 @@ public function getName(); /** * @param string $name - * @return OrderStateInterface + * @return \Dealer4dealer\Xcore\Api\Data\OrderStateInterface */ public function setName($name); } diff --git a/Api/Data/OrderStatusInterface.php b/Api/Data/OrderStatusInterface.php index e35d951..893210a 100644 --- a/Api/Data/OrderStatusInterface.php +++ b/Api/Data/OrderStatusInterface.php @@ -11,7 +11,7 @@ public function getCode(); /** * @param string $code - * @return OrderStatusInterface + * @return \Dealer4dealer\Xcore\Api\Data\OrderStatusInterface */ public function setCode($code); @@ -22,7 +22,7 @@ public function getName(); /** * @param string $name - * @return OrderStatusInterface + * @return \Dealer4dealer\Xcore\Api\Data\OrderStatusInterface */ public function setName($name); } diff --git a/Api/Data/PaymentCostInterface.php b/Api/Data/PaymentCostInterface.php index 18efef0..1c05846 100644 --- a/Api/Data/PaymentCostInterface.php +++ b/Api/Data/PaymentCostInterface.php @@ -2,9 +2,7 @@ namespace Dealer4dealer\Xcore\Api\Data; -use Magento\Framework\Api\ExtensibleDataInterface; - -interface PaymentCostInterface extends ExtensibleDataInterface +interface PaymentCostInterface extends \Magento\Framework\Api\ExtensibleDataInterface { const TITLE = 'title'; const BASE_AMOUNT = 'base_amount'; @@ -22,7 +20,7 @@ public function getTitle(); * Set the title of the payment cost. * * @param string $title - * @return $this + * @return \Dealer4dealer\Xcore\Api\Data\PaymentCostInterface */ public function setTitle($title); @@ -37,7 +35,7 @@ public function getBaseAmount(); * Set the base amount of the payment cost. * * @param float $baseAmount - * @return $this + * @return \Dealer4dealer\Xcore\Api\Data\PaymentCostInterface */ public function setBaseAmount($baseAmount); @@ -52,7 +50,7 @@ public function getAmount(); * Set the amount of the payment cost. * * @param float $amount - * @return $this + * @return \Dealer4dealer\Xcore\Api\Data\PaymentCostInterface */ public function setAmount($amount); diff --git a/Api/Data/PaymentMethodInterface.php b/Api/Data/PaymentMethodInterface.php index 14eed43..39f5d17 100644 --- a/Api/Data/PaymentMethodInterface.php +++ b/Api/Data/PaymentMethodInterface.php @@ -11,7 +11,7 @@ public function getCode(); /** * @param string $code - * @return PaymentMethodInterface + * @return \Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface */ public function setCode($code); @@ -22,7 +22,7 @@ public function getName(); /** * @param string $name - * @return PaymentMethodInterface + * @return \Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface */ public function setName($name); } diff --git a/Api/Data/PriceListInterface.php b/Api/Data/PriceListInterface.php index 52051ee..4d494e8 100644 --- a/Api/Data/PriceListInterface.php +++ b/Api/Data/PriceListInterface.php @@ -20,7 +20,7 @@ public function getId(); * Set id * * @param string $id - * @return PriceListInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function setId($id); @@ -35,7 +35,7 @@ public function getGuid(); * Set guid * * @param string $guid - * @return PriceListInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function setGuid($guid); @@ -50,18 +50,18 @@ public function getCode(); * Set code * * @param string $code - * @return PriceListInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function setCode($code); /** - * @return PriceListItemInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] */ public function getItems(); /** - * @param PriceListItemInterface[] $items - * @return PriceListInterface + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] $items + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function setItems($items); } diff --git a/Api/Data/PriceListItemInterface.php b/Api/Data/PriceListItemInterface.php index 81ce474..b066687 100644 --- a/Api/Data/PriceListItemInterface.php +++ b/Api/Data/PriceListItemInterface.php @@ -24,7 +24,7 @@ public function getId(); * Set id * * @param string $id - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setId($id); @@ -39,7 +39,7 @@ public function getPriceListId(); * Set price_list_id * * @param string $price_list_id - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setPriceListId($price_list_id); @@ -54,7 +54,7 @@ public function getProductSku(); * Set product_sku * * @param string $product_sku - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setProductSku($product_sku); @@ -69,7 +69,7 @@ public function getQty(); * Set qty * * @param string $qty - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setQty($qty); @@ -84,7 +84,7 @@ public function getPrice(); * Set price * * @param string $price - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setPrice($price); @@ -99,7 +99,7 @@ public function getStartDate(); * Set start_date * * @param string $start_date - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setStartDate($start_date); @@ -114,7 +114,7 @@ public function getEndDate(); * Set end_date * * @param string $end_date - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setEndDate($end_date); @@ -129,7 +129,7 @@ public function getProcessed(); * Set processed * * @param string $int - * @return PriceListItemInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface */ public function setProcessed($int); } diff --git a/Api/Data/PriceListItemSearchResultsInterface.php b/Api/Data/PriceListItemSearchResultsInterface.php index a2f4ec1..8b768cd 100644 --- a/Api/Data/PriceListItemSearchResultsInterface.php +++ b/Api/Data/PriceListItemSearchResultsInterface.php @@ -2,22 +2,20 @@ namespace Dealer4dealer\Xcore\Api\Data; -use Magento\Framework\Api\SearchResultsInterface; - -interface PriceListItemSearchResultsInterface extends SearchResultsInterface +interface PriceListItemSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface { /** * Get price_list_item list. * - * @return PriceListItemInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] */ public function getItems(); /** * Set price_list_item list. * - * @param PriceListItemInterface[] $items - * @return $this + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] $items + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterface */ public function setItems(array $items); } diff --git a/Api/Data/PriceListSearchResultsInterface.php b/Api/Data/PriceListSearchResultsInterface.php index 4c813e8..1550c99 100644 --- a/Api/Data/PriceListSearchResultsInterface.php +++ b/Api/Data/PriceListSearchResultsInterface.php @@ -2,22 +2,20 @@ namespace Dealer4dealer\Xcore\Api\Data; -use Magento\Framework\Api\SearchResultsInterface; - -interface PriceListSearchResultsInterface extends SearchResultsInterface +interface PriceListSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface { /** * Get price_list list. * - * @return PriceListInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface[] */ public function getItems(); /** * Set price_list list. * - * @param PriceListInterface[] $items - * @return $this + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterface[] $items + * @return \Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterface */ public function setItems(array $items); } diff --git a/Api/Data/ShippingMethodInterface.php b/Api/Data/ShippingMethodInterface.php index 6d4ae21..e27f60b 100644 --- a/Api/Data/ShippingMethodInterface.php +++ b/Api/Data/ShippingMethodInterface.php @@ -11,7 +11,7 @@ public function getCode(); /** * @param string $code - * @return ShippingMethodInterface + * @return \Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface */ public function setCode($code); @@ -22,7 +22,7 @@ public function getName(); /** * @param string $name - * @return ShippingMethodInterface + * @return \Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface */ public function setName($name); } diff --git a/Api/Data/VersionInterface.php b/Api/Data/VersionInterface.php index 7bc7e23..b8b5c7f 100644 --- a/Api/Data/VersionInterface.php +++ b/Api/Data/VersionInterface.php @@ -11,7 +11,7 @@ public function getMagentoVersion(); /** * @param string $version - * @return VersionInterface + * @return \Dealer4dealer\Xcore\Api\Data\VersionInterface */ public function setMagentoVersion($version); @@ -22,7 +22,7 @@ public function getMagentoEdition(); /** * @param string $edition - * @return VersionInterface + * @return \Dealer4dealer\Xcore\Api\Data\VersionInterface */ public function setMagentoEdition($edition); @@ -33,7 +33,7 @@ public function getRestVersion(); /** * @param string $version - * @return VersionInterface + * @return \Dealer4dealer\Xcore\Api\Data\VersionInterface */ public function setRestVersion($version); } diff --git a/Api/OrderStateRepositoryInterface.php b/Api/OrderStateRepositoryInterface.php index 3287072..e1052d7 100644 --- a/Api/OrderStateRepositoryInterface.php +++ b/Api/OrderStateRepositoryInterface.php @@ -2,14 +2,12 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\OrderStateInterface; - interface OrderStateRepositoryInterface { /** * Get a list of all order states. * - * @return OrderStateInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\OrderStateInterface[] */ public function getList(); } \ No newline at end of file diff --git a/Api/OrderStatusRepositoryInterface.php b/Api/OrderStatusRepositoryInterface.php index 5a0ab4c..a40c09b 100644 --- a/Api/OrderStatusRepositoryInterface.php +++ b/Api/OrderStatusRepositoryInterface.php @@ -2,14 +2,12 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\OrderStatusInterface; - interface OrderStatusRepositoryInterface { /** * Get a list of all order states. * - * @return OrderStatusInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\OrderStatusInterface[] */ public function getList(); } \ No newline at end of file diff --git a/Api/PaymentMethodRepositoryInterface.php b/Api/PaymentMethodRepositoryInterface.php index 4345ab4..d821f47 100644 --- a/Api/PaymentMethodRepositoryInterface.php +++ b/Api/PaymentMethodRepositoryInterface.php @@ -2,14 +2,12 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface; - interface PaymentMethodRepositoryInterface { /** * Get a list of all payment methods. * - * @return PaymentMethodInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface[] */ public function getList(); } \ No newline at end of file diff --git a/Api/PriceListItemRepositoryInterface.php b/Api/PriceListItemRepositoryInterface.php index f9babc7..abba2de 100644 --- a/Api/PriceListItemRepositoryInterface.php +++ b/Api/PriceListItemRepositoryInterface.php @@ -2,57 +2,51 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterface; -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; - interface PriceListItemRepositoryInterface { /** * Save price_list_item * - * @param PriceListItemInterface $priceListItem - * @return PriceListItemInterface - * @throws LocalizedException + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface + * @throws \Magento\Framework\Exception\LocalizedException */ - public function save(PriceListItemInterface $priceListItem); + public function save(\Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem); /** * Retrieve price_list_item * * @param string $priceListItemId - * @return PriceListItemInterface - * @throws LocalizedException + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface + * @throws \Magento\Framework\Exception\LocalizedException */ public function getById($priceListItemId); /** * Retrieve price_list_item matching the specified criteria. * - * @param SearchCriteriaInterface $searchCriteria - * @return PriceListItemSearchResultsInterface - * @throws LocalizedException + * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterface + * @throws \Magento\Framework\Exception\LocalizedException */ - public function getList(SearchCriteriaInterface $searchCriteria); + public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); /** * Delete price_list_item * - * @param PriceListItemInterface $priceListItem + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem * @return bool true on success - * @throws LocalizedException + * @throws \Magento\Framework\Exception\LocalizedException */ - public function delete(PriceListItemInterface $priceListItem); + public function delete(\Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem); /** * Delete price_list_item by ID * * @param string $priceListItemId * @return bool true on success - * @throws NoSuchEntityException - * @throws LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException */ public function deleteById($priceListItemId); } diff --git a/Api/PriceListRepositoryInterface.php b/Api/PriceListRepositoryInterface.php index 3af81cd..ff6e93c 100644 --- a/Api/PriceListRepositoryInterface.php +++ b/Api/PriceListRepositoryInterface.php @@ -2,64 +2,58 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\PriceListInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterface; -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; - interface PriceListRepositoryInterface { /** * Save price_list * - * @param PriceListInterface $priceList - * @return PriceListInterface - * @throws LocalizedException + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface + * @throws \Magento\Framework\Exception\LocalizedException */ - public function save(PriceListInterface $priceList); + public function save(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList); /** * Retrieve price_list by id * * @param string $priceListId - * @return PriceListInterface - * @throws LocalizedException + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface + * @throws \Magento\Framework\Exception\LocalizedException */ public function getById($priceListId); /** * Retrieve price_list matching the specified criteria. * - * @param SearchCriteriaInterface $searchCriteria - * @return PriceListSearchResultsInterface - * @throws LocalizedException + * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria + * @return \Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterface + * @throws \Magento\Framework\Exception\LocalizedException */ - public function getList(SearchCriteriaInterface $searchCriteria); + public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); /** * Delete price_list * - * @param PriceListInterface $priceList + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList * @return bool true on success - * @throws LocalizedException + * @throws \Magento\Framework\Exception\LocalizedException */ - public function delete(PriceListInterface $priceList); + public function delete(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList); /** * Delete price_list by ID * * @param string $priceListId * @return bool true on success - * @throws NoSuchEntityException - * @throws LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException */ public function deleteById($priceListId); /** * Get a JSON result with all price lists. * - * @return PriceListInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface[] */ public function getJsonList(); @@ -68,7 +62,7 @@ public function getJsonList(); * * @param string $id * @param bool $withItems - * @return PriceListInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function getJsonById($id, $withItems); @@ -77,15 +71,15 @@ public function getJsonById($id, $withItems); * * @param string $guid * @param bool $withItems - * @return PriceListInterface + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ public function getJsonByGuid($guid, $withItems); /** * Save a JSON price list * - * @param PriceListInterface $price_list - * @return PriceListInterface + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterface $price_list + * @return \Dealer4dealer\Xcore\Api\Data\PriceListInterface */ - public function saveJson(PriceListInterface $price_list); + public function saveJson(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $price_list); } diff --git a/Api/RestManagementInterface.php b/Api/RestManagementInterface.php index 158dfef..6ad6810 100644 --- a/Api/RestManagementInterface.php +++ b/Api/RestManagementInterface.php @@ -2,14 +2,12 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\VersionInterface; - interface RestManagementInterface { /** * Returns the version of the xCore Rest API. * - * @return VersionInterface + * @return \Dealer4dealer\Xcore\Api\Data\VersionInterface */ public function getVersion(); } \ No newline at end of file diff --git a/Api/ShippingMethodRepositoryInterface.php b/Api/ShippingMethodRepositoryInterface.php index 54c46cf..a7d9b2d 100644 --- a/Api/ShippingMethodRepositoryInterface.php +++ b/Api/ShippingMethodRepositoryInterface.php @@ -2,14 +2,12 @@ namespace Dealer4dealer\Xcore\Api; -use Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface; - interface ShippingMethodRepositoryInterface { /** * Get a list of all shipping methods. * - * @return ShippingMethodInterface[] + * @return \Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface[] */ public function getList(); } \ No newline at end of file diff --git a/Model/AlterShipment.php b/Model/AlterShipment.php index 968c5ca..52af7eb 100644 --- a/Model/AlterShipment.php +++ b/Model/AlterShipment.php @@ -2,19 +2,15 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\AlterShipmentInterface; -use Magento\Framework\Model\AbstractModel; -use Magento\Sales\Api\ShipmentRepositoryInterface; - -class AlterShipment extends AbstractModel implements AlterShipmentInterface +class AlterShipment extends \Magento\Framework\Model\AbstractModel implements \Dealer4dealer\Xcore\Api\AlterShipmentInterface { - /** @var ShipmentRepositoryInterface */ + /** @var \Magento\Sales\Api\ShipmentRepositoryInterface */ private $shipmentRepository; /** - * @param ShipmentRepositoryInterface $shipmentRepository + * @param \Magento\Sales\Api\ShipmentRepositoryInterface $shipmentRepository */ - public function __construct(ShipmentRepositoryInterface $shipmentRepository) + public function __construct(\Magento\Sales\Api\ShipmentRepositoryInterface $shipmentRepository) { $this->shipmentRepository = $shipmentRepository; } diff --git a/Model/Customer/Attribute/Source/VatClass.php b/Model/Customer/Attribute/Source/VatClass.php index b2b8226..d5b50b7 100644 --- a/Model/Customer/Attribute/Source/VatClass.php +++ b/Model/Customer/Attribute/Source/VatClass.php @@ -2,9 +2,7 @@ namespace Dealer4dealer\Xcore\Model\Customer\Attribute\Source; -use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; - -class VatClass extends AbstractSource +class VatClass extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** * getAllOptions diff --git a/Model/OrderState.php b/Model/OrderState.php index c651c5d..45a116d 100644 --- a/Model/OrderState.php +++ b/Model/OrderState.php @@ -2,8 +2,6 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\OrderStateInterface; - -class OrderState extends Method implements OrderStateInterface +class OrderState extends Method implements \Dealer4dealer\Xcore\Api\Data\OrderStateInterface { } diff --git a/Model/OrderStateRepository.php b/Model/OrderStateRepository.php index 7bb077f..f374759 100644 --- a/Model/OrderStateRepository.php +++ b/Model/OrderStateRepository.php @@ -2,15 +2,12 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\OrderStateRepositoryInterface; -use Magento\Sales\Model\ResourceModel\Order\Status\Collection; - -class OrderStateRepository implements OrderStateRepositoryInterface +class OrderStateRepository implements \Dealer4dealer\Xcore\Api\OrderStateRepositoryInterface { private $statusCollection; public function __construct( - Collection $statusCollection + \Magento\Sales\Model\ResourceModel\Order\Status\Collection $statusCollection ) { $this->statusCollection = $statusCollection; diff --git a/Model/OrderStatus.php b/Model/OrderStatus.php index d16f783..b6c961c 100644 --- a/Model/OrderStatus.php +++ b/Model/OrderStatus.php @@ -2,8 +2,6 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\OrderStatusInterface; - -class OrderStatus extends Method implements OrderStatusInterface +class OrderStatus extends Method implements \Dealer4dealer\Xcore\Api\Data\OrderStatusInterface { } diff --git a/Model/OrderStatusRepository.php b/Model/OrderStatusRepository.php index 253eb50..1291173 100644 --- a/Model/OrderStatusRepository.php +++ b/Model/OrderStatusRepository.php @@ -2,15 +2,12 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\OrderStatusRepositoryInterface; -use Magento\Sales\Model\ResourceModel\Order\Status\Collection; - -class OrderStatusRepository implements OrderStatusRepositoryInterface +class OrderStatusRepository implements \Dealer4dealer\Xcore\Api\OrderStatusRepositoryInterface { private $statusCollection; public function __construct( - Collection $statusCollection + \Magento\Sales\Model\ResourceModel\Order\Status\Collection $statusCollection ) { $this->statusCollection = $statusCollection; diff --git a/Model/PaymentCost.php b/Model/PaymentCost.php index dd054f0..ab5b9a7 100644 --- a/Model/PaymentCost.php +++ b/Model/PaymentCost.php @@ -2,10 +2,7 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PaymentCostInterface; -use Magento\Framework\DataObject; - -class PaymentCost extends DataObject implements PaymentCostInterface +class PaymentCost extends \Magento\Framework\DataObject implements \Dealer4dealer\Xcore\Api\Data\PaymentCostInterface { protected $title; protected $baseAmount; diff --git a/Model/PaymentMethod.php b/Model/PaymentMethod.php index 4d27a0f..b44509b 100644 --- a/Model/PaymentMethod.php +++ b/Model/PaymentMethod.php @@ -2,8 +2,6 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface; - -class PaymentMethod extends Method implements PaymentMethodInterface +class PaymentMethod extends Method implements \Dealer4dealer\Xcore\Api\Data\PaymentMethodInterface { } diff --git a/Model/PaymentMethodRepository.php b/Model/PaymentMethodRepository.php index 322d98f..1235b3c 100644 --- a/Model/PaymentMethodRepository.php +++ b/Model/PaymentMethodRepository.php @@ -2,20 +2,17 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\PaymentMethodRepositoryInterface; -use Magento\Payment\Helper\Data; - -class PaymentMethodRepository implements PaymentMethodRepositoryInterface +class PaymentMethodRepository implements \Dealer4dealer\Xcore\Api\PaymentMethodRepositoryInterface { - /** @var Data */ + /** @var \Magento\Payment\Helper\Data */ private $paymentHelper; /** * PaymentMethodRepository constructor. * - * @param Data $paymentHelper + * @param \Magento\Payment\Helper\Data $paymentHelper */ - public function __construct(Data $paymentHelper) + public function __construct(\Magento\Payment\Helper\Data $paymentHelper) { $this->paymentHelper = $paymentHelper; } diff --git a/Model/PriceList.php b/Model/PriceList.php index 0fb0a2d..5f8e6f8 100644 --- a/Model/PriceList.php +++ b/Model/PriceList.php @@ -2,13 +2,9 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PriceListInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterface; -use Magento\Framework\Model\AbstractModel; - -class PriceList extends AbstractModel implements PriceListInterface +class PriceList extends \Magento\Framework\Model\AbstractModel implements \Dealer4dealer\Xcore\Api\Data\PriceListInterface { - /** @var PriceListItemInterface[] */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] */ protected $items; /** diff --git a/Model/PriceList/Attribute/Source/PriceList.php b/Model/PriceList/Attribute/Source/PriceList.php index e7bd790..e6fd646 100644 --- a/Model/PriceList/Attribute/Source/PriceList.php +++ b/Model/PriceList/Attribute/Source/PriceList.php @@ -2,12 +2,7 @@ namespace Dealer4dealer\Xcore\Model\PriceList\Attribute\Source; -use Dealer4dealer\Xcore\Model\PriceListRepository; -use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Exception\LocalizedException; - -class PriceList extends AbstractSource +class PriceList extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { protected $_priceListRepository; protected $_searchCriteriaBuilder; @@ -15,11 +10,11 @@ class PriceList extends AbstractSource /** * Constructor * - * @param PriceListRepository $priceListRepository - * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Dealer4dealer\Xcore\Model\PriceListRepository $priceListRepository + * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder */ - public function __construct(PriceListRepository $priceListRepository, - SearchCriteriaBuilder $searchCriteriaBuilder) + public function __construct(\Dealer4dealer\Xcore\Model\PriceListRepository $priceListRepository, + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder) { $this->_priceListRepository = $priceListRepository; $this->_searchCriteriaBuilder = $searchCriteriaBuilder; @@ -29,7 +24,7 @@ public function __construct(PriceListRepository $priceListRepository, * getAllOptions * * @return array - * @throws LocalizedException + * @throws \Magento\Framework\Exception\LocalizedException */ public function getAllOptions() { diff --git a/Model/PriceListItem.php b/Model/PriceListItem.php index 1327bcd..75db591 100644 --- a/Model/PriceListItem.php +++ b/Model/PriceListItem.php @@ -2,10 +2,7 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterface; -use Magento\Framework\Model\AbstractModel; - -class PriceListItem extends AbstractModel implements PriceListItemInterface +class PriceListItem extends \Magento\Framework\Model\AbstractModel implements \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface { /** * @return void diff --git a/Model/PriceListItemRepository.php b/Model/PriceListItemRepository.php index 06805b1..7c4a449 100644 --- a/Model/PriceListItemRepository.php +++ b/Model/PriceListItemRepository.php @@ -2,24 +2,7 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterfaceFactory; -use Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterfaceFactory; -use Dealer4dealer\Xcore\Api\PriceListItemRepositoryInterface; -use Dealer4dealer\Xcore\Model\ResourceModel\PriceList\Collection; -use Dealer4dealer\Xcore\Model\ResourceModel\PriceListItem\CollectionFactory as PriceListItemCollectionFactory; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\Framework\Api\SortOrder; -use Magento\Framework\App\Config\Base; -use Magento\Framework\App\Config\BaseFactory; -use Magento\Framework\Exception\CouldNotDeleteException; -use Magento\Framework\Exception\CouldNotSaveException; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Exception\NoSuchEntityException; - -class PriceListItemRepository implements PriceListItemRepositoryInterface +class PriceListItemRepository implements \Dealer4dealer\Xcore\Api\PriceListItemRepositoryInterface { protected $priceListItemFactory; protected $priceListItemCollectionFactory; @@ -27,17 +10,17 @@ class PriceListItemRepository implements PriceListItemRepositoryInterface protected $searchCriteriaBuilder; /** - * @param PriceListItemFactory|BaseFactory $priceListItemFactory - * @param PriceListItemCollectionFactory|BaseFactory $priceListItemCollectionFactory - * @param PriceListItemSearchResultsInterfaceFactory|BaseFactory $searchResultsFactory + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterfaceFactory|\Magento\Framework\App\Config\BaseFactory $priceListItemFactory + * @param \Dealer4dealer\Xcore\Model\ResourceModel\PriceListItem\CollectionFactory|\Magento\Framework\App\Config\BaseFactory $priceListItemCollectionFactory + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterfaceFactory|\Magento\Framework\App\Config\BaseFactory $searchResultsFactory * - * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder */ public function __construct( - PriceListItemFactory $priceListItemFactory, - PriceListItemCollectionFactory $priceListItemCollectionFactory, - PriceListItemSearchResultsInterfaceFactory $searchResultsFactory, - SearchCriteriaBuilder $searchCriteriaBuilder + \Dealer4dealer\Xcore\Api\Data\PriceListItemInterfaceFactory $priceListItemFactory, + \Dealer4dealer\Xcore\Model\ResourceModel\PriceListItem\CollectionFactory $priceListItemCollectionFactory, + \Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterfaceFactory $searchResultsFactory, + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder ) { $this->priceListItemFactory = $priceListItemFactory; @@ -49,13 +32,13 @@ public function __construct( /** * {@inheritdoc} */ - public function save(PriceListItemInterface $priceListItem) + public function save(\Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem) { try { /** @var PriceListItem $priceListItem */ $priceListItem->getResource()->save($priceListItem); } catch (\Exception $exception) { - throw new CouldNotSaveException(__(sprintf('Could not save the Price List Item: %s', $exception->getMessage()))); + throw new \Magento\Framework\Exception\CouldNotSaveException(__(sprintf('Could not save the Price List Item: %s', $exception->getMessage()))); } return $priceListItem; } @@ -69,7 +52,7 @@ public function getById($priceListItemId) $priceListItem = $this->priceListItemFactory->create(); $priceListItem->getResource()->load($priceListItem, $priceListItemId); if (!$priceListItem->getId()) { - throw new NoSuchEntityException(__(sprintf('Price List Item with id %s does not exist', $priceListItemId))); + throw new \Magento\Framework\Exception\NoSuchEntityException(__(sprintf('Price List Item with id %s does not exist', $priceListItemId))); } return $priceListItem; } @@ -77,9 +60,9 @@ public function getById($priceListItemId) /** * {@inheritdoc} */ - public function getList(SearchCriteriaInterface $criteria) + public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria) { - /** @var Collection $collection */ + /** @var \Dealer4dealer\Xcore\Model\ResourceModel\PriceList\Collection $collection */ $collection = $this->priceListItemCollectionFactory->create(); foreach ($criteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { @@ -94,18 +77,18 @@ public function getList(SearchCriteriaInterface $criteria) $sortOrders = $criteria->getSortOrders(); if ($sortOrders) { - /** @var SortOrder $sortOrder */ + /** @var \Magento\Framework\Api\SortOrder $sortOrder */ foreach ($sortOrders as $sortOrder) { $collection->addOrder( $sortOrder->getField(), - ($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC' + ($sortOrder->getDirection() == \Magento\Framework\Api\SortOrder::SORT_ASC) ? 'ASC' : 'DESC' ); } } $collection->setCurPage($criteria->getCurrentPage()); $collection->setPageSize($criteria->getPageSize()); - /** @var PriceListItemSearchResultsInterface $searchResults */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListItemSearchResultsInterface $searchResults */ $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($criteria); $searchResults->setTotalCount($collection->getSize()); @@ -116,13 +99,13 @@ public function getList(SearchCriteriaInterface $criteria) /** * {@inheritdoc} */ - public function delete(PriceListItemInterface $priceListItem) + public function delete(\Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $priceListItem) { try { /** @var PriceListItem $priceListItem */ $priceListItem->getResource()->delete($priceListItem); } catch (\Exception $exception) { - throw new CouldNotDeleteException(__(sprintf('Could not delete the price_list_item: %s', $exception->getMessage()))); + throw new \Magento\Framework\Exception\CouldNotDeleteException(__(sprintf('Could not delete the price_list_item: %s', $exception->getMessage()))); } return true; } @@ -141,8 +124,8 @@ public function deleteById($priceListItemId) * @param $productSku * @param $qty * @param null $priceListId - * @return PriceListItemInterface|Base - * @throws LocalizedException + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface|\Magento\Framework\App\Config\Base + * @throws \Magento\Framework\Exception\LocalizedException */ public function getUniqueRow($productSku, $qty, $priceListId = null) { @@ -162,8 +145,8 @@ public function getUniqueRow($productSku, $qty, $priceListId = null) * Returns the price list items that belong to a specific price list. * * @param int $priceListId - * @return PriceListItemInterface[] - * @throws LocalizedException + * @return \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] + * @throws \Magento\Framework\Exception\LocalizedException */ public function getByPriceListId($priceListId) { diff --git a/Model/PriceListRepository.php b/Model/PriceListRepository.php index 0cc6674..8868389 100644 --- a/Model/PriceListRepository.php +++ b/Model/PriceListRepository.php @@ -2,25 +2,7 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\PriceListInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListInterfaceFactory; -use Dealer4dealer\Xcore\Api\Data\PriceListItemInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterface; -use Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterfaceFactory; -use Dealer4dealer\Xcore\Api\PriceListRepositoryInterface; -use Dealer4dealer\Xcore\Model\ResourceModel\PriceList as ResourcePriceList; -use Dealer4dealer\Xcore\Model\ResourceModel\PriceList\CollectionFactory as PriceListCollectionFactory; -use Magento\Framework\Api\SearchCriteria; -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\Framework\Api\SortOrder; -use Magento\Framework\App\Config\BaseFactory; -use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Framework\Exception\CouldNotDeleteException; -use Magento\Framework\Exception\CouldNotSaveException; -use Magento\Framework\Exception\NoSuchEntityException; -use Psr\Log\LoggerInterface; - -class PriceListRepository implements PriceListRepositoryInterface +class PriceListRepository implements \Dealer4dealer\Xcore\Api\PriceListRepositoryInterface { protected $logger; protected $priceListFactory; @@ -29,18 +11,17 @@ class PriceListRepository implements PriceListRepositoryInterface protected $priceListItemRepository; /** - * @param LoggerInterface $logger - * @param PriceListFactory|BaseFactory $priceListFactory - * @param PriceListCollectionFactory|BaseFactory $priceListCollectionFactory - * @param PriceListSearchResultsInterfaceFactory|BaseFactory $searchResultsFactory - * - * @param PriceListItemRepository $priceListItemRepository + * @param \Psr\Log\LoggerInterface $logger + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterfaceFactory|\Magento\Framework\App\Config\BaseFactory $priceListFactory + * @param \Dealer4dealer\Xcore\Model\ResourceModel\PriceList\CollectionFactory|\Magento\Framework\App\Config\BaseFactory $priceListCollectionFactory + * @param \Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterfaceFactory|\Magento\Framework\App\Config\BaseFactory $searchResultsFactory + * @param \Dealer4dealer\Xcore\Api\PriceListItemRepositoryInterface $priceListItemRepository */ - public function __construct(LoggerInterface $logger, - PriceListFactory $priceListFactory, - PriceListCollectionFactory $priceListCollectionFactory, - PriceListSearchResultsInterfaceFactory $searchResultsFactory, - PriceListItemRepository $priceListItemRepository) + public function __construct(\Psr\Log\LoggerInterface $logger, + \Dealer4dealer\Xcore\Api\Data\PriceListInterfaceFactory $priceListFactory, + \Dealer4dealer\Xcore\Model\ResourceModel\PriceList\CollectionFactory $priceListCollectionFactory, + \Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterfaceFactory $searchResultsFactory, + \Dealer4dealer\Xcore\Api\PriceListItemRepositoryInterface $priceListItemRepository) { $this->logger = $logger; $this->priceListFactory = $priceListFactory; @@ -52,13 +33,13 @@ public function __construct(LoggerInterface $logger, /** * {@inheritdoc} */ - public function save(PriceListInterface $priceList) + public function save(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList) { try { /** @var PriceList $priceList */ $priceList->getResource()->save($priceList); } catch (\Exception $exception) { - throw new CouldNotSaveException(__(sprintf('Could not save the Price List: %s', $exception->getMessage()))); + throw new \Magento\Framework\Exception\CouldNotSaveException(__(sprintf('Could not save the Price List: %s', $exception->getMessage()))); } return $priceList; } @@ -72,7 +53,7 @@ public function getById($priceListId) $priceList = $this->priceListFactory->create(); $priceList->getResource()->load($priceList, $priceListId); if (!$priceList->getId()) { - throw new NoSuchEntityException(__(sprintf('Price List with id %s does not exist', $priceListId))); + throw new \Magento\Framework\Exception\NoSuchEntityException(__(sprintf('Price List with id %s does not exist', $priceListId))); } return $priceList; @@ -81,9 +62,9 @@ public function getById($priceListId) /** * {@inheritdoc} */ - public function getList(SearchCriteriaInterface $criteria) + public function getList(\Magento\Framework\Api\SearchCriteriaInterface $criteria) { - /** @var ResourcePriceList\Collection $collection */ + /** @var \Dealer4dealer\Xcore\Model\ResourceModel\PriceList\Collection $collection */ $collection = $this->priceListCollectionFactory->create(); foreach ($criteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { @@ -98,18 +79,18 @@ public function getList(SearchCriteriaInterface $criteria) $sortOrders = $criteria->getSortOrders(); if ($sortOrders) { - /** @var SortOrder $sortOrder */ + /** @var \Magento\Framework\Api\SortOrder $sortOrder */ foreach ($sortOrders as $sortOrder) { $collection->addOrder( $sortOrder->getField(), - ($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC' + ($sortOrder->getDirection() == \Magento\Framework\Api\SortOrder::SORT_ASC) ? 'ASC' : 'DESC' ); } } $collection->setCurPage($criteria->getCurrentPage()); $collection->setPageSize($criteria->getPageSize()); - /** @var PriceListSearchResultsInterface $searchResults */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListSearchResultsInterface $searchResults */ $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($criteria); $searchResults->setTotalCount($collection->getSize()); @@ -120,13 +101,13 @@ public function getList(SearchCriteriaInterface $criteria) /** * {@inheritdoc} */ - public function delete(PriceListInterface $priceList) + public function delete(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList) { try { /** @var PriceList $priceList */ $priceList->getResource()->delete($priceList); } catch (\Exception $exception) { - throw new CouldNotDeleteException(__(sprintf('Could not delete the Price List: %s', $exception->getMessage()))); + throw new \Magento\Framework\Exception\CouldNotDeleteException(__(sprintf('Could not delete the Price List: %s', $exception->getMessage()))); } return true; } @@ -144,12 +125,12 @@ public function deleteById($priceListId) */ public function getJsonList() { - /** @var ResourcePriceList\Collection $collection */ - $collection = $this->getList(new SearchCriteria()); + /** @var \Dealer4dealer\Xcore\Model\ResourceModel\PriceList\Collection $collection */ + $collection = $this->getList(new \Magento\Framework\Api\SearchCriteria()); $result = []; - /** @var PriceListInterface $priceList */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListInterface $priceList */ foreach ($collection->getItems() as $priceList) { // $priceList->setItems($this->priceListItemRepository->getByPriceListId($priceList->getId())); @@ -198,15 +179,15 @@ public function getJsonByGuid($guid, $withItems = true) /** * {@inheritdoc} */ - public function saveJson(PriceListInterface $price_list) + public function saveJson(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $price_list) { $priceList = $this->getOrSavePriceList($price_list); if ($price_list->getItems()) { - /** @var PriceListItemInterface[] $items */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface[] $items */ $items = []; - /** @var PriceListItemInterface $item */ + /** @var \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $item */ foreach ($price_list->getItems() as $item) { $addedItem = $this->getOrSavePriceListItem($priceList->getId(), $item); if ($addedItem) $items[] = $addedItem; @@ -219,11 +200,11 @@ public function saveJson(PriceListInterface $price_list) } /** - * @param PriceListInterface $newPriceList + * @param \Dealer4dealer\Xcore\Api\Data\PriceListInterface $newPriceList * @return PriceList - * @throws AlreadyExistsException + * @throws \Magento\Framework\Exception\AlreadyExistsException */ - private function getOrSavePriceList(PriceListInterface $newPriceList) + private function getOrSavePriceList(\Dealer4dealer\Xcore\Api\Data\PriceListInterface $newPriceList) { /** @var PriceList $priceList */ $priceList = $this->priceListFactory->create(); @@ -238,11 +219,11 @@ private function getOrSavePriceList(PriceListInterface $newPriceList) } /** - * @param int $priceListId - * @param PriceListItemInterface $item + * @param int $priceListId + * @param \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $item * @return PriceListItem */ - private function getOrSavePriceListItem($priceListId, PriceListItemInterface $item) + private function getOrSavePriceListItem($priceListId, \Dealer4dealer\Xcore\Api\Data\PriceListItemInterface $item) { try { /** @var PriceListItem $priceListItem */ diff --git a/Model/ResourceModel/PriceList.php b/Model/ResourceModel/PriceList.php index e88629d..f3fa9f8 100644 --- a/Model/ResourceModel/PriceList.php +++ b/Model/ResourceModel/PriceList.php @@ -2,9 +2,7 @@ namespace Dealer4dealer\Xcore\Model\ResourceModel; -use Magento\Framework\Model\ResourceModel\Db\AbstractDb; - -class PriceList extends AbstractDb +class PriceList extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { /** * Define resource model diff --git a/Model/ResourceModel/PriceList/Collection.php b/Model/ResourceModel/PriceList/Collection.php index a943181..c9b44b9 100644 --- a/Model/ResourceModel/PriceList/Collection.php +++ b/Model/ResourceModel/PriceList/Collection.php @@ -2,10 +2,7 @@ namespace Dealer4dealer\Xcore\Model\ResourceModel\PriceList; -use Dealer4dealer\Xcore\Model\PriceList; -use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; - -class Collection extends AbstractCollection +class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { /** * Define resource model @@ -15,7 +12,7 @@ class Collection extends AbstractCollection protected function _construct() { $this->_init( - PriceList::class, + \Dealer4dealer\Xcore\Model\PriceList::class, \Dealer4dealer\Xcore\Model\ResourceModel\PriceList::class ); } diff --git a/Model/ResourceModel/PriceListItem.php b/Model/ResourceModel/PriceListItem.php index 59a36b1..be7996e 100644 --- a/Model/ResourceModel/PriceListItem.php +++ b/Model/ResourceModel/PriceListItem.php @@ -2,9 +2,7 @@ namespace Dealer4dealer\Xcore\Model\ResourceModel; -use Magento\Framework\Model\ResourceModel\Db\AbstractDb; - -class PriceListItem extends AbstractDb +class PriceListItem extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { /** * Define resource model diff --git a/Model/ResourceModel/PriceListItem/Collection.php b/Model/ResourceModel/PriceListItem/Collection.php index 8738977..03f75f6 100644 --- a/Model/ResourceModel/PriceListItem/Collection.php +++ b/Model/ResourceModel/PriceListItem/Collection.php @@ -2,10 +2,7 @@ namespace Dealer4dealer\Xcore\Model\ResourceModel\PriceListItem; -use Dealer4dealer\Xcore\Model\PriceListItem; -use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; - -class Collection extends AbstractCollection +class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { /** * Define resource model @@ -15,7 +12,7 @@ class Collection extends AbstractCollection protected function _construct() { $this->_init( - PriceListItem::class, + \Dealer4dealer\Xcore\Model\PriceListItem::class, \Dealer4dealer\Xcore\Model\ResourceModel\PriceListItem::class ); } diff --git a/Model/RestManagement.php b/Model/RestManagement.php index 0cb55f1..58dd64b 100644 --- a/Model/RestManagement.php +++ b/Model/RestManagement.php @@ -2,18 +2,14 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\RestManagementInterface; -use Magento\Framework\App\ProductMetadataInterface; -use Magento\Framework\Module\ModuleListInterface; - -class RestManagement implements RestManagementInterface +class RestManagement implements \Dealer4dealer\Xcore\Api\RestManagementInterface { const MODULE_NAME = 'Dealer4dealer_Xcore'; protected $productMetadata; protected $moduleList; - public function __construct(ProductMetadataInterface $productMetadata, - ModuleListInterface $moduleList) + public function __construct(\Magento\Framework\App\ProductMetadataInterface $productMetadata, + \ModuleListInterface $moduleList) { $this->productMetadata = $productMetadata; $this->moduleList = $moduleList; diff --git a/Model/ShippingMethod.php b/Model/ShippingMethod.php index e6985f4..2527385 100644 --- a/Model/ShippingMethod.php +++ b/Model/ShippingMethod.php @@ -2,8 +2,6 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface; - -class ShippingMethod extends Method implements ShippingMethodInterface +class ShippingMethod extends Method implements \Dealer4dealer\Xcore\Api\Data\ShippingMethodInterface { } diff --git a/Model/ShippingMethodRepository.php b/Model/ShippingMethodRepository.php index fda914c..a0de568 100644 --- a/Model/ShippingMethodRepository.php +++ b/Model/ShippingMethodRepository.php @@ -2,20 +2,17 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\ShippingMethodRepositoryInterface; -use Magento\Shipping\Model\Config; - -class ShippingMethodRepository implements ShippingMethodRepositoryInterface +class ShippingMethodRepository implements \Dealer4dealer\Xcore\Api\ShippingMethodRepositoryInterface { - /**@var Config */ + /**@var \Magento\Shipping\Model\Config */ private $shippingConfig; /** * ShippingMethodRepository constructor. * - * @param Config $shippingConfig + * @param \Magento\Shipping\Model\Config $shippingConfig */ - public function __construct(Config $shippingConfig) + public function __construct(\Magento\Shipping\Model\Config $shippingConfig) { $this->shippingConfig = $shippingConfig; } diff --git a/Model/Version.php b/Model/Version.php index 0a2d0e3..f283b81 100644 --- a/Model/Version.php +++ b/Model/Version.php @@ -2,9 +2,7 @@ namespace Dealer4dealer\Xcore\Model; -use Dealer4dealer\Xcore\Api\Data\VersionInterface; - -class Version implements VersionInterface +class Version implements \Dealer4dealer\Xcore\Api\Data\VersionInterface { protected $magentoVersion; protected $magentoEdition;