From 31a29734965712a683e4025abc1eaabd9524222d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 24 Oct 2020 17:52:23 +0200 Subject: [PATCH] cs and phpstan fixes --- Controller/ApiController.php | 3 +-- Models/AccountMapper.php | 2 +- Models/AddressMapper.php | 30 +++++++++++++++--------------- Models/LocalizationMapper.php | 2 +- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 75c26d6..369b355 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -254,8 +254,7 @@ final class ApiController extends Controller $requestAccount = $request->getHeader()->getAccount(); $accountId = (int) $request->getData('account_id'); - if ( - $requestAccount !== $accountId + if ($requestAccount !== $accountId && !$this->app->accountManager->get($accountId)->hasPermission( PermissionType::MODIFY, $this->app->orgId, diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index 4267045..de50c5d 100755 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -55,7 +55,7 @@ final class AccountMapper extends DataMapperAbstract /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ protected static array $ownsOne = [ diff --git a/Models/AddressMapper.php b/Models/AddressMapper.php index dbad376..c6a1bf5 100755 --- a/Models/AddressMapper.php +++ b/Models/AddressMapper.php @@ -34,30 +34,30 @@ final class AddressMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - 'address_id' => ['name' => 'address_id', 'type' => 'int', 'internal' => 'id'], - 'address_name' => ['name' => 'address_name', 'type' => 'string', 'internal' => 'name'], - 'address_addition' => ['name' => 'address_addition', 'type' => 'string', 'internal' => 'addition'], - 'address_address' => ['name' => 'address_address', 'type' => 'string', 'internal' => 'address'], - 'address_postal' => ['name' => 'address_postal', 'type' => 'string', 'internal' => 'postal'], - 'address_state' => ['name' => 'address_state', 'type' => 'string', 'internal' => 'state'], - 'address_city' => ['name' => 'address_city', 'type' => 'string', 'internal' => 'city'], - 'address_country' => ['name' => 'address_country', 'type' => 'string', 'internal' => 'country'], - 'address_type' => ['name' => 'address_type', 'type' => 'int', 'internal' => 'type'], + 'address_id' => ['name' => 'address_id', 'type' => 'int', 'internal' => 'id'], + 'address_name' => ['name' => 'address_name', 'type' => 'string', 'internal' => 'name'], + 'address_addition' => ['name' => 'address_addition', 'type' => 'string', 'internal' => 'addition'], + 'address_address' => ['name' => 'address_address', 'type' => 'string', 'internal' => 'address'], + 'address_postal' => ['name' => 'address_postal', 'type' => 'string', 'internal' => 'postal'], + 'address_state' => ['name' => 'address_state', 'type' => 'string', 'internal' => 'state'], + 'address_city' => ['name' => 'address_city', 'type' => 'string', 'internal' => 'city'], + 'address_country' => ['name' => 'address_country', 'type' => 'string', 'internal' => 'country'], + 'address_type' => ['name' => 'address_type', 'type' => 'int', 'internal' => 'type'], ]; /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ protected static array $ownsOne = [ 'country' => [ - 'mapper' => CountryMapper::class, - 'external' => 'address_country', - 'by' => 'code2', - 'column' => 'code2', - 'conditional' => true, + 'mapper' => CountryMapper::class, + 'external' => 'address_country', + 'by' => 'code2', + 'column' => 'code2', + 'conditional' => true, ], ]; diff --git a/Models/LocalizationMapper.php b/Models/LocalizationMapper.php index 44a6aee..a930ade 100755 --- a/Models/LocalizationMapper.php +++ b/Models/LocalizationMapper.php @@ -94,7 +94,7 @@ final class LocalizationMapper extends DataMapperAbstract /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ protected static array $ownsOne = [