Skip to content

Commit

Permalink
FRW-7400 Upgraded PHPStan to 1.10.*. (#10911)
Browse files Browse the repository at this point in the history
FRW-7400 Update PHPStan to 1.10.*
  • Loading branch information
olhalivitchuk authored May 6, 2024
1 parent c0b2a04 commit e60fa4a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/Spryker/Zed/Acl/Business/Model/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public function findRoleById(int $id): ?RoleTransfer
*/
public function removeRoleById($idRole)
{
/** @var \Propel\Runtime\Collection\ObjectCollection $aclRules */
$aclRules = $this->queryContainer->queryRuleByRoleId($idRole)->find();
$aclRules->delete();

Expand Down
1 change: 1 addition & 0 deletions src/Spryker/Zed/Acl/Business/Model/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public function findByRoles(
*/
public function getRulesForGroupId($idGroup)
{
/** @var \Propel\Runtime\Collection\ObjectCollection $relationshipCollection */
$relationshipCollection = $this->queryContainer->queryGroupHasRole($idGroup)->find();
/** @var array<\Orm\Zed\Acl\Persistence\SpyAclRole> $roleCollection */
$roleCollection = $this->queryContainer->queryGroupRules($relationshipCollection)->find();
Expand Down
6 changes: 3 additions & 3 deletions src/Spryker/Zed/Acl/Communication/AclCommunicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public function createGroupTable()
*/
public function getGroupRoleListByGroupId($idAclGroup)
{
/** @var \Propel\Runtime\Collection\ObjectCollection $roleCollection */
$roleCollection = $this->getQueryContainer()
->queryGroupRoles($idAclGroup)
->find()
->toArray();
->find();

return [
'code' => Response::HTTP_OK,
'idGroup' => $idAclGroup,
'data' => $roleCollection,
'data' => $roleCollection->toArray(),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,20 @@ public function getOptions()
*/
protected function getAvailableRoleListByIdGroup($idAclGroup)
{
$roleCollection = $this->queryContainer->queryGroupHasRole($idAclGroup)->find()->toArray();
/** @var \Propel\Runtime\Collection\ObjectCollection $roleCollection */
$roleCollection = $this->queryContainer->queryGroupHasRole($idAclGroup)->find();

return array_column($roleCollection, 'FkAclRole');
return array_column($roleCollection->toArray(), 'FkAclRole');
}

/**
* @return array
*/
protected function getAvailableRoleList()
{
$roleCollection = $this->queryContainer->queryRole()->find()->toArray();
/** @var \Propel\Runtime\Collection\ObjectCollection $roleCollection */
$roleCollection = $this->queryContainer->queryRole()->find();

return array_column($roleCollection, 'IdAclRole', 'Name');
return array_column($roleCollection->toArray(), 'IdAclRole', 'Name');
}
}
6 changes: 3 additions & 3 deletions src/Spryker/Zed/Acl/Persistence/Propel/Mapper/AclMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Orm\Zed\Acl\Persistence\SpyAclGroup;
use Orm\Zed\Acl\Persistence\SpyAclRole;
use Orm\Zed\Acl\Persistence\SpyAclUserHasGroup;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Collection\Collection;

class AclMapper
{
Expand Down Expand Up @@ -72,13 +72,13 @@ public function mapAclRoleTransferToRoleEntity(RoleTransfer $roleTransfer, SpyAc
}

/**
* @param \Propel\Runtime\Collection\ObjectCollection<\Orm\Zed\Acl\Persistence\SpyAclUserHasGroup> $aclUserHasGroupEntities
* @param \Propel\Runtime\Collection\Collection<\Orm\Zed\Acl\Persistence\SpyAclUserHasGroup> $aclUserHasGroupEntities
* @param \Generated\Shared\Transfer\AclUserHasGroupCollectionTransfer $aclUserHasGroupCollectionTransfer
*
* @return \Generated\Shared\Transfer\AclUserHasGroupCollectionTransfer
*/
public function mapAclUserHasGroupEntitiesToAclUserHasGroupCollectionTransfer(
ObjectCollection $aclUserHasGroupEntities,
Collection $aclUserHasGroupEntities,
AclUserHasGroupCollectionTransfer $aclUserHasGroupCollectionTransfer
): AclUserHasGroupCollectionTransfer {
foreach ($aclUserHasGroupEntities as $aclUserHasGroupEntity) {
Expand Down

0 comments on commit e60fa4a

Please sign in to comment.