Skip to content

Commit

Permalink
minor #109 Bump CI workflows and fix CS (derrabus)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x-dev branch.

Discussion
----------

Bump CI workflows and fix CS

* Bumped PHP CS Fixer to 3.11.0 and ran it
* Added a PHPUnit job for PHP 8.2

Commits
-------

a2f4126 Bump CI workflows and fix CS
  • Loading branch information
derrabus committed Sep 18, 2022
2 parents 3f15abc + a2f4126 commit f24881e
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.2.5', '7.3', '7.4', '8.0', '8.1']
php: ['7.2.5', '7.3', '7.4', '8.0', '8.1', '8.2']
include:
- php: '7.4'
deps: lowest
Expand Down Expand Up @@ -56,6 +56,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:3.5.0
uses: docker://oskarstark/php-cs-fixer-ga:3.11.0
with:
args: --diff --dry-run
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:
jobs:
psalm:
name: Psalm
runs-on: Ubuntu-20.04
runs-on: Ubuntu-22.04

steps:
- name: Setup PHP
Expand Down
30 changes: 15 additions & 15 deletions Dbal/AclProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,21 @@ private function hydrateObjectIdentities(Result $stmt, array $oidLookup, array $
// but it is faster
foreach ($stmt->fetchAllNumeric() as $data) {
[$aclId,
$objectIdentifier,
$parentObjectIdentityId,
$entriesInheriting,
$classType,
$aceId,
$objectIdentityId,
$fieldName,
$aceOrder,
$mask,
$granting,
$grantingStrategy,
$auditSuccess,
$auditFailure,
$username,
$securityIdentifier] = array_values($data);
$objectIdentifier,
$parentObjectIdentityId,
$entriesInheriting,
$classType,
$aceId,
$objectIdentityId,
$fieldName,
$aceOrder,
$mask,
$granting,
$grantingStrategy,
$auditSuccess,
$auditFailure,
$username,
$securityIdentifier] = array_values($data);

// FIX: remove duplicate slashes
$classType = str_replace('\\\\', '\\', $classType);
Expand Down
20 changes: 10 additions & 10 deletions Dbal/MutableAclProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ protected function getInsertObjectIdentitySql($identifier, $classId, $entriesInh
/**
* Constructs the SQL for inserting a security identity.
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getInsertSecurityIdentitySql(SecurityIdentityInterface $sid)
{
Expand Down Expand Up @@ -623,9 +623,9 @@ protected function getSelectClassIdSql($classType)
/**
* Constructs the SQL for selecting the primary key of a security identity.
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid)
{
Expand All @@ -650,9 +650,9 @@ protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid
/**
* Constructs the SQL to delete a security identity.
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid)
{
Expand All @@ -667,9 +667,9 @@ protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid
*
* @param int $pk
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getUpdateObjectIdentitySql($pk, array $changes)
{
Expand Down Expand Up @@ -715,9 +715,9 @@ protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid,
*
* @param int $pk
*
* @throws \InvalidArgumentException
*
* @return string
*
* @throws \InvalidArgumentException
*/
protected function getUpdateAccessControlEntrySql($pk, array $sets)
{
Expand Down
18 changes: 10 additions & 8 deletions Domain/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,22 @@ public function __serialize(): array
public function __unserialize(array $data): void
{
[$this->parentAcl,
$this->objectIdentity,
$this->classAces,
$this->classFieldAces,
$this->objectAces,
$this->objectFieldAces,
$this->id,
$this->loadedSids,
$this->entriesInheriting
$this->objectIdentity,
$this->classAces,
$this->classFieldAces,
$this->objectAces,
$this->objectFieldAces,
$this->id,
$this->loadedSids,
$this->entriesInheriting
] = $data;

$this->listeners = [];
}

/**
* @internal
*
* @final
*
* @return string
Expand All @@ -290,6 +291,7 @@ public function serialize()

/**
* @internal
*
* @final
*
* @param string $serialized
Expand Down
14 changes: 8 additions & 6 deletions Domain/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,18 @@ public function __serialize(): array
public function __unserialize(array $data): void
{
[$this->mask,
$this->id,
$this->securityIdentity,
$this->strategy,
$this->auditFailure,
$this->auditSuccess,
$this->granting
$this->id,
$this->securityIdentity,
$this->strategy,
$this->auditFailure,
$this->auditSuccess,
$this->granting
] = $data;
}

/**
* @internal
*
* @final
*
* @return string
Expand All @@ -197,6 +198,7 @@ public function serialize()

/**
* @internal
*
* @final
*
* @param string $serialized
Expand Down
4 changes: 2 additions & 2 deletions Domain/ObjectIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function __construct($identifier, $type)
*
* @param object $domainObject
*
* @throws InvalidDomainObjectException
*
* @return ObjectIdentity
*
* @throws InvalidDomainObjectException
*/
public static function fromDomainObject($domainObject)
{
Expand Down
4 changes: 2 additions & 2 deletions Model/AclInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ public function isFieldGranted(string $field, array $masks, array $securityIdent
/**
* Determines whether access is granted.
*
* @throws NoAceFoundException when no ACE was applicable for this request
*
* @return bool
*
* @throws NoAceFoundException when no ACE was applicable for this request
*/
public function isGranted(array $masks, array $securityIdentities, bool $administrativeMode = false);

Expand Down
4 changes: 2 additions & 2 deletions Model/MutableAclProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function findAcls(array $oids, array $sids = []);
/**
* Creates a new ACL for the given object identity.
*
* @return MutableAclInterface
*
* @throws AclAlreadyExistsException when there already is an ACL for the given
* object identity
*
* @return MutableAclInterface
*/
public function createAcl(ObjectIdentityInterface $oid);

Expand Down
4 changes: 2 additions & 2 deletions Permission/MaskBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ public function getPattern()
*
* @param int $mask
*
* @return string
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
*
* @return string
*/
public static function getCode($mask)
{
Expand Down
1 change: 1 addition & 0 deletions Tests/Domain/SecurityIdentityRetrievalStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function testGetSecurityIdentities($user, array $roles, string $authentic

/**
* @group legacy
*
* @dataProvider getDeprecatedSecurityIdentityRetrievalTests
*/
public function testDeprecatedGetSecurityIdentities($user, array $roles, string $authenticationStatus, array $sids)
Expand Down

0 comments on commit f24881e

Please sign in to comment.