From 967542d6f9fa5078cc1db0c5c708fbc8b4d8a421 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 27 Nov 2020 22:56:15 +0100 Subject: [PATCH] phpstan fixes --- Controller/ApiController.php | 3 +- Models/Client.php | 112 ++--------------------------------- 2 files changed, 6 insertions(+), 109 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 6484b37..606a77d 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -19,6 +19,7 @@ use Modules\Admin\Models\Address; use Modules\ClientManagement\Models\Client; use Modules\ClientManagement\Models\ClientMapper; use Modules\Profile\Models\Profile; +use Modules\Profile\Models\ContactElementMapper; use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\NotificationLevel; use phpOMS\Message\RequestAbstract; @@ -89,7 +90,7 @@ final class ApiController extends Controller $addr->city = $request->getData('city') ?? ''; $addr->setCountry($request->getData('country') ?? ''); $addr->state = $request->getData('state') ?? ''; - $client->setMainAddress($addr); + $client->mainAddress = $addr; return $client; } diff --git a/Models/Client.php b/Models/Client.php index 5ce00ac..5e34c6f 100644 --- a/Models/Client.php +++ b/Models/Client.php @@ -53,19 +53,19 @@ class Client private array $contactElements = []; - private $mainAddress = null; + public Address $mainAddress; private array $address = []; private array $partners = []; - private $salesRep = null; + private ?Profile $salesRep = null; private int $advertisementMaterial = 0; - private $defaultDeliveryAddress = null; + public ?Address $defaultDeliveryAddress = null; - private $defaultInvoiceAddress = null; + public ?Address $defaultInvoiceAddress = null; /** * Constructor. @@ -173,84 +173,6 @@ class Client $this->type = $type; } - /** - * Get tax id. - * - * @return int - * - * @since 1.0.0 - */ - public function getTaxId() : int - { - return $this->taxId; - } - - /** - * Set tax id. - * - * @param int $taxId Tax id - * - * @return void - * - * @since 1.0.0 - */ - public function setTaxId(int $taxId) : void - { - $this->taxId = $taxId; - } - - /** - * Set default delivery address. - * - * @param mixed $deliveryAddress Delivery address - * - * @return void - * - * @since 1.0.0 - */ - public function setDefaultDeliveryAddress($deliveryAddress) : void - { - $this->defaultDeliveryAddress = $deliveryAddress; - } - - /** - * Get default delivery address. - * - * @return mixed - * - * @since 1.0.0 - */ - public function getDefaultDeliveryAddress() - { - return $this->defaultDeliveryAddress; - } - - /** - * Set default invoice address. - * - * @param mixed $invoiceAddress Invoice address - * - * @return void - * - * @since 1.0.0 - */ - public function setDefaultInvoiceAddress($invoiceAddress) : void - { - $this->defaultTnvoiceAddress = $invoiceAddress; - } - - /** - * Get default invoice address. - * - * @return mixed - * - * @since 1.0.0 - */ - public function getDefaultInvoiceAddress() - { - return $this->defaultInvoiceAddress; - } - /** * Get info. * @@ -277,32 +199,6 @@ class Client $this->info = $info; } - /** - * Set main address - * - * @param int|Address $address Address - * - * @return void - * - * @since 1.0.0 - */ - public function setMainAddress($address) : void - { - $this->mainAddress = $address; - } - - /** - * Get main address - * - * @return int|Address - * - * @since 1.0.0 - */ - public function getMainAddress() - { - return $this->mainAddress; - } - /** * Get media. *