phpstan fixes

This commit is contained in:
Dennis Eichhorn 2020-11-27 22:56:16 +01:00
parent 4107ebc336
commit ecef1dee93
2 changed files with 9 additions and 62 deletions

View File

@ -17,6 +17,7 @@ namespace Modules\SupplierManagement\Controller;
use Modules\Admin\Models\Account; use Modules\Admin\Models\Account;
use Modules\Admin\Models\Address; use Modules\Admin\Models\Address;
use Modules\Profile\Models\Profile; use Modules\Profile\Models\Profile;
use Modules\Profile\Models\ContactElementMapper;
use Modules\SupplierManagement\Models\Supplier; use Modules\SupplierManagement\Models\Supplier;
use Modules\SupplierManagement\Models\SupplierMapper; use Modules\SupplierManagement\Models\SupplierMapper;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
@ -89,7 +90,7 @@ final class ApiController extends Controller
$addr->city = $request->getData('city') ?? ''; $addr->city = $request->getData('city') ?? '';
$addr->state = $request->getData('state') ?? ''; $addr->state = $request->getData('state') ?? '';
$addr->setCountry($request->getData('country') ?? ''); $addr->setCountry($request->getData('country') ?? '');
$supplier->setMainAddress($addr); $supplier->mainAddress = $addr;
return $supplier; return $supplier;
} }

View File

@ -47,21 +47,19 @@ class Supplier
private int $type = 0; private int $type = 0;
private $taxId = 0; public string $info = '';
private $info = ''; private \DateTimeImmutable $createdAt;
private $createdAt = null; public Profile $profile;
public $profile = null; private array $files = [];
private $files = []; private array $contactElements = [];
private $contactElements = []; private array $address = [];
private $address = []; public Address $mainAddress;
private $mainAddress;
/** /**
* Constructor. * Constructor.
@ -169,32 +167,6 @@ class Supplier
$this->type = $type; $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;
}
/** /**
* Get info. * Get info.
* *
@ -221,32 +193,6 @@ class Supplier
$this->info = $info; $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. * Get media.
* *