From fab629594c84dfe85ab73ec7b492ad6f6f425277 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Tue, 6 Aug 2024 10:48:32 -0400 Subject: [PATCH 01/10] Updated UPGRADE.md for v2 Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- UPGRADE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 7c80de9..896c6d4 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,23 @@ # Upgrade guide +## From LmcRbac v1 to LmcRbac v2 + +LmcRbac v2 is a major version upgrade with many breaking changes that prevent +straightforward upgrading. + +### Namespace change + +The namespace has been changed from LmcRbac to Lmc\Rbac. Please review your code to replace `LmcRbac` namespace +by `Lmc\Rbac` namespace. + +### Deprecations + +- `Lmc\Rbac\HierarchicalRole` has been deprecated since `Lmc\Rbac\Role` now supports hierarchical roles. Flat roles +are just a simplified version of a hierarchical roles. Use `Lmc\Rbac\Role` instead. +- The factories for services have been refactored from the `src/Container` folder + to be colocated with the service that a factory is creating. All factories in the `src/Container` has been deprecated. +- The `AssertionContainer` class, interface and factory have been deprecated and replaced by `AssertionPluginManager` class, interface and factory. + ## From ZfcRbac v3 to LmcRbac v1 The ZF-Commons organisation has been moved to LM-Commons and ZfcRbac has been split into two repositories. From 3f3ed015153e982d028473551ca07584dee19091 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Tue, 6 Aug 2024 11:07:32 -0400 Subject: [PATCH 02/10] Changed namespace to Lmc\Rbac Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- composer.json | 2 +- data/FlatRole.php.dist | 4 +-- data/HierarchicalRole.php.dist | 6 ++-- data/Permission.php.dist | 2 +- data/Role.php.dist | 5 ++-- src/Assertion/AssertionContainer.php | 2 +- src/Assertion/AssertionContainerFactory.php | 2 +- src/Assertion/AssertionContainerInterface.php | 2 +- src/Assertion/AssertionInterface.php | 6 ++-- src/Assertion/AssertionPluginManager.php | 4 +-- .../AssertionPluginManagerFactory.php | 2 +- .../AssertionPluginManagerInterface.php | 2 +- src/Assertion/AssertionSet.php | 10 +++---- src/ConfigProvider.php | 20 ++++++------- src/Container/AssertionContainerFactory.php | 8 ++--- src/Container/AuthorizationServiceFactory.php | 16 +++++----- src/Container/InMemoryRoleProviderFactory.php | 10 +++---- src/Container/ModuleOptionsFactory.php | 8 ++--- .../ObjectRepositoryRoleProviderFactory.php | 12 ++++---- src/Container/RoleServiceFactory.php | 10 +++---- src/Exception/ExceptionInterface.php | 2 +- src/Exception/InvalidArgumentException.php | 2 +- src/Exception/RoleNotFoundException.php | 2 +- src/Exception/RuntimeException.php | 2 +- src/Exception/UnauthorizedException.php | 2 +- .../UnauthorizedExceptionInterface.php | 2 +- src/Identity/IdentityInterface.php | 4 +-- src/Module.php | 2 +- src/Options/ModuleOptions.php | 6 ++-- src/Options/ModuleOptionsFactory.php | 4 +-- src/Permission/PermissionInterface.php | 2 +- src/Rbac.php | 6 ++-- src/RbacInterface.php | 6 ++-- src/Role/HierarchicalRole.php | 2 +- src/Role/HierarchicalRoleInterface.php | 2 +- src/Role/InMemoryRoleProvider.php | 2 +- src/Role/InMemoryRoleProviderFactory.php | 6 ++-- src/Role/ObjectRepositoryRoleProvider.php | 4 +-- .../ObjectRepositoryRoleProviderFactory.php | 8 ++--- src/Role/Role.php | 4 +-- src/Role/RoleInterface.php | 4 +-- src/Role/RoleProviderInterface.php | 2 +- src/Service/AuthorizationService.php | 12 ++++---- .../AuthorizationServiceAwareInterface.php | 2 +- .../AuthorizationServiceAwareTrait.php | 2 +- .../AuthorizationServiceDelegatorFactory.php | 2 +- src/Service/AuthorizationServiceFactory.php | 14 ++++----- src/Service/AuthorizationServiceInterface.php | 6 ++-- src/Service/RoleService.php | 8 ++--- src/Service/RoleServiceFactory.php | 4 +-- src/Service/RoleServiceInterface.php | 6 ++-- test/Assertion/AssertionPluginManagerTest.php | 6 ++-- test/Assertion/AssertionSetTest.php | 16 +++++----- test/Asset/Identity.php | 2 +- test/Asset/Permission.php | 2 +- test/Asset/Role.php | 4 +-- test/Asset/SimpleAssertion.php | 6 ++-- test/ConfigProviderTest.php | 18 +++++------ .../AssertionPluginManagerFactoryTest.php | 10 +++---- .../AuthorizationServiceFactoryTest.php | 18 +++++------ .../InMemoryRoleProviderFactoryTest.php | 8 ++--- test/Container/ModuleOptionsFactoryTest.php | 6 ++-- ...bjectRepositoryRoleProviderFactoryTest.php | 10 +++---- test/Container/RoleServiceFactoryTest.php | 14 ++++----- test/ModuleTest.php | 6 ++-- test/Options/ModuleOptionsTest.php | 10 +++---- test/Rbac/RbacTest.php | 24 +++++++-------- test/Role/InMemoryRoleProviderTest.php | 6 ++-- .../Role/ObjectRepositoryRoleProviderTest.php | 16 +++++----- test/Role/RoleTest.php | 18 +++++------ .../AuthorizationServiceAwareTraitTest.php | 2 +- ...thorizationServiceDelegatorFactoryTest.php | 4 +-- test/Service/AuthorizationServiceTest.php | 30 +++++++++---------- .../DummyAuthorizationServiceClass.php | 4 +-- test/Service/RoleServiceTest.php | 14 ++++----- 75 files changed, 259 insertions(+), 260 deletions(-) diff --git a/composer.json b/composer.json index 009a3e9..790d953 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,7 @@ }, "autoload": { "psr-4": { - "LmcRbac\\": "src/" + "Lmc\\Rbac\\": "src/" } }, "autoload-dev": { diff --git a/data/FlatRole.php.dist b/data/FlatRole.php.dist index 2f8fa13..9bd49ea 100644 --- a/data/FlatRole.php.dist +++ b/data/FlatRole.php.dist @@ -21,8 +21,8 @@ declare(strict_types=1); use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Permission\PermissionInterface; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Permission\PermissionInterface; +use Lmc\Rbac\Role\RoleInterface; /** * @ORM\Entity diff --git a/data/HierarchicalRole.php.dist b/data/HierarchicalRole.php.dist index 6b21bdd..ea4e54c 100644 --- a/data/HierarchicalRole.php.dist +++ b/data/HierarchicalRole.php.dist @@ -21,7 +21,7 @@ declare(strict_types=1); use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Role\RoleInterface; /** * @ORM\Entity @@ -120,7 +120,7 @@ class HierarchicalRole implements RoleInterface * @param string|Permission $permission * @return void */ - public function addPermission(string|Permission|\LmcRbac\Permission\PermissionInterface $permission): void + public function addPermission(string|Permission|\Lmc\Rbac\Permission\PermissionInterface $permission): void { if (is_string($permission)) { $permission = new Permission($permission); @@ -133,7 +133,7 @@ class HierarchicalRole implements RoleInterface * @param $permission * @return bool */ - public function hasPermission(string|\LmcRbac\Permission\PermissionInterface $permission): bool + public function hasPermission(string|\Lmc\Rbac\Permission\PermissionInterface $permission): bool { // This can be a performance problem if your role has a lot of permissions. Please refer // to the cookbook to an elegant way to solve this issue diff --git a/data/Permission.php.dist b/data/Permission.php.dist index f6d84fe..841b383 100644 --- a/data/Permission.php.dist +++ b/data/Permission.php.dist @@ -19,7 +19,7 @@ declare(strict_types=1); */ use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Permission\PermissionInterface; +use Lmc\Rbac\Permission\PermissionInterface; /** * @ORM\Entity diff --git a/data/Role.php.dist b/data/Role.php.dist index 7df58db..5cc5202 100644 --- a/data/Role.php.dist +++ b/data/Role.php.dist @@ -21,9 +21,8 @@ declare(strict_types=1); use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Permission\PermissionInterface; -use LmcRbac\Role\RoleInterface; -use LmcRbacTest\Asset\Permission; +use Lmc\Rbac\Permission\PermissionInterface; +use Lmc\Rbac\Role\RoleInterface; /** * @ORM\Entity diff --git a/src/Assertion/AssertionContainer.php b/src/Assertion/AssertionContainer.php index f32ed12..fd85584 100644 --- a/src/Assertion/AssertionContainer.php +++ b/src/Assertion/AssertionContainer.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Assertion; +namespace Lmc\Rbac\Assertion; use Laminas\ServiceManager\AbstractPluginManager; diff --git a/src/Assertion/AssertionContainerFactory.php b/src/Assertion/AssertionContainerFactory.php index 25aba37..71dac6e 100644 --- a/src/Assertion/AssertionContainerFactory.php +++ b/src/Assertion/AssertionContainerFactory.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Assertion; +namespace Lmc\Rbac\Assertion; use Psr\Container\ContainerInterface; diff --git a/src/Assertion/AssertionContainerInterface.php b/src/Assertion/AssertionContainerInterface.php index 6cfc6c1..ad7a161 100644 --- a/src/Assertion/AssertionContainerInterface.php +++ b/src/Assertion/AssertionContainerInterface.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Assertion; +namespace Lmc\Rbac\Assertion; use Psr\Container\ContainerInterface; diff --git a/src/Assertion/AssertionInterface.php b/src/Assertion/AssertionInterface.php index 33dbbe8..2b46733 100644 --- a/src/Assertion/AssertionInterface.php +++ b/src/Assertion/AssertionInterface.php @@ -19,10 +19,10 @@ declare(strict_types=1); -namespace LmcRbac\Assertion; +namespace Lmc\Rbac\Assertion; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Permission\PermissionInterface; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Permission\PermissionInterface; /** * Interface that you can implement for dynamic assertions diff --git a/src/Assertion/AssertionPluginManager.php b/src/Assertion/AssertionPluginManager.php index 2d34023..cbb8b93 100644 --- a/src/Assertion/AssertionPluginManager.php +++ b/src/Assertion/AssertionPluginManager.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace LmcRbac\Assertion; +namespace Lmc\Rbac\Assertion; use Laminas\ServiceManager\AbstractPluginManager; use Laminas\ServiceManager\Exception\InvalidServiceException; @@ -19,7 +19,7 @@ public function validate(mixed $instance): void return; } throw new InvalidServiceException(sprintf( - 'Assertions must implement "LmcRbac\Assertion\AssertionInterface", but "%s" was given', + 'Assertions must implement "Lmc\Rbac\Assertion\AssertionInterface", but "%s" was given', get_class($instance) )); } diff --git a/src/Assertion/AssertionPluginManagerFactory.php b/src/Assertion/AssertionPluginManagerFactory.php index e22e423..7c275a0 100644 --- a/src/Assertion/AssertionPluginManagerFactory.php +++ b/src/Assertion/AssertionPluginManagerFactory.php @@ -1,6 +1,6 @@ [ - \LmcRbac\Assertion\AssertionPluginManager::class => \LmcRbac\Assertion\AssertionPluginManagerFactory::class, - \LmcRbac\Options\ModuleOptions::class => \LmcRbac\Options\ModuleOptionsFactory::class, - \LmcRbac\Role\InMemoryRoleProvider::class => \LmcRbac\Role\InMemoryRoleProviderFactory::class, - \LmcRbac\Role\ObjectRepositoryRoleProvider::class => \LmcRbac\Role\ObjectRepositoryRoleProviderFactory::class, - \LmcRbac\Service\AuthorizationServiceInterface::class => \LmcRbac\Service\AuthorizationServiceFactory::class, - \LmcRbac\Service\RoleServiceInterface::class => \LmcRbac\Service\RoleServiceFactory::class, - \LmcRbac\Rbac::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, + \Lmc\Rbac\Assertion\AssertionPluginManager::class => \Lmc\Rbac\Assertion\AssertionPluginManagerFactory::class, + \Lmc\Rbac\Options\ModuleOptions::class => \Lmc\Rbac\Options\ModuleOptionsFactory::class, + \Lmc\Rbac\Role\InMemoryRoleProvider::class => \Lmc\Rbac\Role\InMemoryRoleProviderFactory::class, + \Lmc\Rbac\Role\ObjectRepositoryRoleProvider::class => \Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory::class, + \Lmc\Rbac\Service\AuthorizationServiceInterface::class => \Lmc\Rbac\Service\AuthorizationServiceFactory::class, + \Lmc\Rbac\Service\RoleServiceInterface::class => \Lmc\Rbac\Service\RoleServiceFactory::class, + \Lmc\Rbac\Rbac::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, ], ]; } diff --git a/src/Container/AssertionContainerFactory.php b/src/Container/AssertionContainerFactory.php index 9c65931..7cdefc6 100644 --- a/src/Container/AssertionContainerFactory.php +++ b/src/Container/AssertionContainerFactory.php @@ -19,9 +19,9 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; -use LmcRbac\Assertion\AssertionContainer; +use Lmc\Rbac\Assertion\AssertionContainer; use Psr\Container\ContainerInterface; /** @@ -29,8 +29,8 @@ * * @author Aeneas Rekkas * @licence MIT - * @deprecated Replaced by LmcRbac\Assertion\AssertionContainerFactory + * @deprecated Replaced by Lmc\Rbac\Assertion\AssertionContainerFactory */ -final class AssertionContainerFactory extends \LmcRbac\Assertion\AssertionContainerFactory +final class AssertionContainerFactory extends \Lmc\Rbac\Assertion\AssertionContainerFactory { } diff --git a/src/Container/AuthorizationServiceFactory.php b/src/Container/AuthorizationServiceFactory.php index 99ada46..8a719e8 100644 --- a/src/Container/AuthorizationServiceFactory.php +++ b/src/Container/AuthorizationServiceFactory.php @@ -19,13 +19,13 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; -use LmcRbac\Assertion\AssertionContainerInterface; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Rbac; -use LmcRbac\Service\AuthorizationService; -use LmcRbac\Service\RoleServiceInterface; +use Lmc\Rbac\Assertion\AssertionContainerInterface; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Rbac; +use Lmc\Rbac\Service\AuthorizationService; +use Lmc\Rbac\Service\RoleServiceInterface; use Psr\Container\ContainerInterface; /** @@ -33,8 +33,8 @@ * * @author Michaël Gallego * @licence MIT - * @deprecated Replaced by LmcRbac\Service\AuthorizationServiceFactory + * @deprecated Replaced by Lmc\Rbac\Service\AuthorizationServiceFactory */ -final class AuthorizationServiceFactory extends \LmcRbac\Service\AuthorizationServiceFactory +final class AuthorizationServiceFactory extends \Lmc\Rbac\Service\AuthorizationServiceFactory { } diff --git a/src/Container/InMemoryRoleProviderFactory.php b/src/Container/InMemoryRoleProviderFactory.php index 697fede..582f261 100644 --- a/src/Container/InMemoryRoleProviderFactory.php +++ b/src/Container/InMemoryRoleProviderFactory.php @@ -19,10 +19,10 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Role\InMemoryRoleProvider; use Psr\Container\ContainerInterface; /** @@ -30,8 +30,8 @@ * * @author Vytautas Stankus * @licence MIT - * @deprecated Replaced by LmcRbac\Role\InMemoryRoleProviderFactory + * @deprecated Replaced by Lmc\Rbac\Role\InMemoryRoleProviderFactory */ -final class InMemoryRoleProviderFactory extends \LmcRbac\Role\InMemoryRoleProviderFactory +final class InMemoryRoleProviderFactory extends \Lmc\Rbac\Role\InMemoryRoleProviderFactory { } diff --git a/src/Container/ModuleOptionsFactory.php b/src/Container/ModuleOptionsFactory.php index 43adcea..5dc2c47 100644 --- a/src/Container/ModuleOptionsFactory.php +++ b/src/Container/ModuleOptionsFactory.php @@ -19,9 +19,9 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; -use LmcRbac\Options\ModuleOptions; +use Lmc\Rbac\Options\ModuleOptions; use Psr\Container\ContainerInterface; /** @@ -29,8 +29,8 @@ * * @author Michaël Gallego * @licence MIT - * @deprecated Replaced by LmcRbac\Options\ModuleOptionsFactory + * @deprecated Replaced by Lmc\Rbac\Options\ModuleOptionsFactory */ -final class ModuleOptionsFactory extends \LmcRbac\Options\ModuleOptionsFactory +final class ModuleOptionsFactory extends \Lmc\Rbac\Options\ModuleOptionsFactory { } diff --git a/src/Container/ObjectRepositoryRoleProviderFactory.php b/src/Container/ObjectRepositoryRoleProviderFactory.php index e8ca2cc..543182f 100644 --- a/src/Container/ObjectRepositoryRoleProviderFactory.php +++ b/src/Container/ObjectRepositoryRoleProviderFactory.php @@ -19,11 +19,11 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; -use LmcRbac\Exception; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Role\ObjectRepositoryRoleProvider; +use Lmc\Rbac\Exception; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Role\ObjectRepositoryRoleProvider; use Psr\Container\ContainerInterface; /** @@ -31,8 +31,8 @@ * * @author Michaël Gallego * @licence MIT - * @deprecated Replaced by LmcRbac\Role\ObjectRepositoryRoleProviderFactory + * @deprecated Replaced by Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory */ -final class ObjectRepositoryRoleProviderFactory extends \LmcRbac\Role\ObjectRepositoryRoleProviderFactory +final class ObjectRepositoryRoleProviderFactory extends \Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory { } diff --git a/src/Container/RoleServiceFactory.php b/src/Container/RoleServiceFactory.php index fae8eeb..d6bbdb0 100644 --- a/src/Container/RoleServiceFactory.php +++ b/src/Container/RoleServiceFactory.php @@ -19,11 +19,11 @@ declare(strict_types=1); -namespace LmcRbac\Container; +namespace Lmc\Rbac\Container; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Service\RoleService; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Service\RoleService; use Psr\Container\ContainerInterface; /** @@ -31,8 +31,8 @@ * * @author Michaël Gallego * @licence MIT - * @deprecated Replaced by LmcRbac\Service\RoleServiceFactory + * @deprecated Replaced by Lmc\Rbac\Service\RoleServiceFactory */ -final class RoleServiceFactory extends \LmcRbac\Service\RoleServiceFactory +final class RoleServiceFactory extends \Lmc\Rbac\Service\RoleServiceFactory { } diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index 3532219..1530467 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; /** * Base exception interface for LmcRbac diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 42030c8..9bfb483 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; use InvalidArgumentException as BaseInvalidArgumentException; diff --git a/src/Exception/RoleNotFoundException.php b/src/Exception/RoleNotFoundException.php index 54df6e6..ae10677 100644 --- a/src/Exception/RoleNotFoundException.php +++ b/src/Exception/RoleNotFoundException.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; use RuntimeException as BaseRuntimeException; diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index ea06345..788ee2f 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; use RuntimeException as BaseRuntimeException; diff --git a/src/Exception/UnauthorizedException.php b/src/Exception/UnauthorizedException.php index d540277..69ce3fd 100644 --- a/src/Exception/UnauthorizedException.php +++ b/src/Exception/UnauthorizedException.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; use RuntimeException as BaseRuntimeException; diff --git a/src/Exception/UnauthorizedExceptionInterface.php b/src/Exception/UnauthorizedExceptionInterface.php index 1fb3955..ee0077c 100644 --- a/src/Exception/UnauthorizedExceptionInterface.php +++ b/src/Exception/UnauthorizedExceptionInterface.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Exception; +namespace Lmc\Rbac\Exception; /** * Interface for an unauthorized exception diff --git a/src/Identity/IdentityInterface.php b/src/Identity/IdentityInterface.php index 654bb14..5327b09 100644 --- a/src/Identity/IdentityInterface.php +++ b/src/Identity/IdentityInterface.php @@ -19,9 +19,9 @@ declare(strict_types=1); -namespace LmcRbac\Identity; +namespace Lmc\Rbac\Identity; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Role\RoleInterface; /** * Interface for an identity diff --git a/src/Module.php b/src/Module.php index 8a6645e..8148ee6 100644 --- a/src/Module.php +++ b/src/Module.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac; +namespace Lmc\Rbac; final class Module { diff --git a/src/Options/ModuleOptions.php b/src/Options/ModuleOptions.php index 7e8dbae..3aa85a4 100644 --- a/src/Options/ModuleOptions.php +++ b/src/Options/ModuleOptions.php @@ -19,7 +19,7 @@ declare(strict_types=1); -namespace LmcRbac\Options; +namespace Lmc\Rbac\Options; use Laminas\Stdlib\AbstractOptions; @@ -34,7 +34,7 @@ class ModuleOptions extends AbstractOptions /** * Key of the identity provider used to retrieve the identity */ - protected string $identityProvider = 'LmcRbac\Identity\AuthenticationIdentityProvider'; + protected string $identityProvider = 'Lmc\Rbac\Identity\AuthenticationIdentityProvider'; /** * Guest role (used when no identity is found) @@ -57,7 +57,7 @@ class ModuleOptions extends AbstractOptions * @var array */ protected array $roleProvider = [ - 'LmcRbac\Role\InMemoryRoleProvider' => [], + 'Lmc\Rbac\Role\InMemoryRoleProvider' => [], ]; /** diff --git a/src/Options/ModuleOptionsFactory.php b/src/Options/ModuleOptionsFactory.php index 9c7fda2..d905f59 100644 --- a/src/Options/ModuleOptionsFactory.php +++ b/src/Options/ModuleOptionsFactory.php @@ -19,9 +19,9 @@ declare(strict_types=1); -namespace LmcRbac\Options; +namespace Lmc\Rbac\Options; -use LmcRbac\Options\ModuleOptions; +use Lmc\Rbac\Options\ModuleOptions; use Psr\Container\ContainerInterface; /** diff --git a/src/Permission/PermissionInterface.php b/src/Permission/PermissionInterface.php index 59b6e4b..21ad8b7 100644 --- a/src/Permission/PermissionInterface.php +++ b/src/Permission/PermissionInterface.php @@ -1,6 +1,6 @@ diff --git a/src/Service/AuthorizationServiceAwareTrait.php b/src/Service/AuthorizationServiceAwareTrait.php index 9edead1..b7df369 100644 --- a/src/Service/AuthorizationServiceAwareTrait.php +++ b/src/Service/AuthorizationServiceAwareTrait.php @@ -16,7 +16,7 @@ * and is licensed under the MIT license. */ -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; /** * @author Eric Richer diff --git a/src/Service/AuthorizationServiceDelegatorFactory.php b/src/Service/AuthorizationServiceDelegatorFactory.php index 243959c..b5dfaee 100644 --- a/src/Service/AuthorizationServiceDelegatorFactory.php +++ b/src/Service/AuthorizationServiceDelegatorFactory.php @@ -16,7 +16,7 @@ * and is licensed under the MIT license. */ -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; /** * @author Eric Richer diff --git a/src/Service/AuthorizationServiceFactory.php b/src/Service/AuthorizationServiceFactory.php index f3b1ff5..8381d34 100644 --- a/src/Service/AuthorizationServiceFactory.php +++ b/src/Service/AuthorizationServiceFactory.php @@ -19,14 +19,14 @@ declare(strict_types=1); -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; -use LmcRbac\Assertion\AssertionContainerInterface; -use LmcRbac\Assertion\AssertionPluginManagerInterface; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Rbac; -use LmcRbac\Service\AuthorizationService; -use LmcRbac\Service\RoleServiceInterface; +use Lmc\Rbac\Assertion\AssertionContainerInterface; +use Lmc\Rbac\Assertion\AssertionPluginManagerInterface; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Rbac; +use Lmc\Rbac\Service\AuthorizationService; +use Lmc\Rbac\Service\RoleServiceInterface; use Psr\Container\ContainerInterface; /** diff --git a/src/Service/AuthorizationServiceInterface.php b/src/Service/AuthorizationServiceInterface.php index bd1cd34..6f11422 100644 --- a/src/Service/AuthorizationServiceInterface.php +++ b/src/Service/AuthorizationServiceInterface.php @@ -19,10 +19,10 @@ declare(strict_types=1); -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Permission\PermissionInterface; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Permission\PermissionInterface; /** * Minimal interface for an authorization service diff --git a/src/Service/RoleService.php b/src/Service/RoleService.php index 6b3bd36..316298f 100644 --- a/src/Service/RoleService.php +++ b/src/Service/RoleService.php @@ -19,11 +19,11 @@ declare(strict_types=1); -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Role\RoleInterface; -use LmcRbac\Role\RoleProviderInterface; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Role\RoleInterface; +use Lmc\Rbac\Role\RoleProviderInterface; use Traversable; /** diff --git a/src/Service/RoleServiceFactory.php b/src/Service/RoleServiceFactory.php index b19004f..cfaae74 100644 --- a/src/Service/RoleServiceFactory.php +++ b/src/Service/RoleServiceFactory.php @@ -19,10 +19,10 @@ declare(strict_types=1); -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; -use LmcRbac\Options\ModuleOptions; +use Lmc\Rbac\Options\ModuleOptions; use Psr\Container\ContainerInterface; /** diff --git a/src/Service/RoleServiceInterface.php b/src/Service/RoleServiceInterface.php index 7d8585e..7385a78 100644 --- a/src/Service/RoleServiceInterface.php +++ b/src/Service/RoleServiceInterface.php @@ -19,10 +19,10 @@ declare(strict_types=1); -namespace LmcRbac\Service; +namespace Lmc\Rbac\Service; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Role\RoleInterface; /** * Role service diff --git a/test/Assertion/AssertionPluginManagerTest.php b/test/Assertion/AssertionPluginManagerTest.php index 6a2a0fc..79b9368 100644 --- a/test/Assertion/AssertionPluginManagerTest.php +++ b/test/Assertion/AssertionPluginManagerTest.php @@ -24,13 +24,13 @@ use Interop\Container\ContainerInterface; use Laminas\ServiceManager\Exception\InvalidServiceException; use Laminas\ServiceManager\Factory\InvokableFactory; -use LmcRbac\Assertion\AssertionInterface; -use LmcRbac\Assertion\AssertionPluginManager; +use Lmc\Rbac\Assertion\AssertionInterface; +use Lmc\Rbac\Assertion\AssertionPluginManager; use LmcRbacTest\Asset\SimpleAssertion; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Assertion\AssertionPluginManager + * @covers \Lmc\Rbac\Assertion\AssertionPluginManager */ class AssertionPluginManagerTest extends TestCase { diff --git a/test/Assertion/AssertionSetTest.php b/test/Assertion/AssertionSetTest.php index 452f604..6d4cbf2 100644 --- a/test/Assertion/AssertionSetTest.php +++ b/test/Assertion/AssertionSetTest.php @@ -20,18 +20,18 @@ namespace LmcRbacTest\Assertion; -use LmcRbac\Assertion\AssertionContainerInterface; -use LmcRbac\Assertion\AssertionInterface; -use LmcRbac\Assertion\AssertionPluginManager; -use LmcRbac\Assertion\AssertionPluginManagerInterface; -use LmcRbac\Assertion\AssertionSet; -use LmcRbac\Exception\InvalidArgumentException; -use LmcRbac\Identity\IdentityInterface; +use Lmc\Rbac\Assertion\AssertionContainerInterface; +use Lmc\Rbac\Assertion\AssertionInterface; +use Lmc\Rbac\Assertion\AssertionPluginManager; +use Lmc\Rbac\Assertion\AssertionPluginManagerInterface; +use Lmc\Rbac\Assertion\AssertionSet; +use Lmc\Rbac\Exception\InvalidArgumentException; +use Lmc\Rbac\Identity\IdentityInterface; use LmcRbacTest\Asset\SimpleAssertion; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Assertion\AssertionSet + * @covers \Lmc\Rbac\Assertion\AssertionSet */ class AssertionSetTest extends TestCase { diff --git a/test/Asset/Identity.php b/test/Asset/Identity.php index a91da37..5ae7931 100644 --- a/test/Asset/Identity.php +++ b/test/Asset/Identity.php @@ -21,7 +21,7 @@ namespace LmcRbacTest\Asset; -use LmcRbac\Identity\IdentityInterface; +use Lmc\Rbac\Identity\IdentityInterface; class Identity implements IdentityInterface { diff --git a/test/Asset/Permission.php b/test/Asset/Permission.php index ca2c5eb..25b7655 100644 --- a/test/Asset/Permission.php +++ b/test/Asset/Permission.php @@ -21,7 +21,7 @@ namespace LmcRbacTest\Asset; use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Permission\PermissionInterface; +use Lmc\Rbac\Permission\PermissionInterface; /** * @ORM\Entity diff --git a/test/Asset/Role.php b/test/Asset/Role.php index e047b07..3f9446b 100644 --- a/test/Asset/Role.php +++ b/test/Asset/Role.php @@ -23,8 +23,8 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use LmcRbac\Permission\PermissionInterface; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Permission\PermissionInterface; +use Lmc\Rbac\Role\RoleInterface; /** * @ORM\Entity diff --git a/test/Asset/SimpleAssertion.php b/test/Asset/SimpleAssertion.php index 063946c..3e77162 100644 --- a/test/Asset/SimpleAssertion.php +++ b/test/Asset/SimpleAssertion.php @@ -21,9 +21,9 @@ namespace LmcRbacTest\Asset; -use LmcRbac\Assertion\AssertionInterface; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Permission\PermissionInterface; +use Lmc\Rbac\Assertion\AssertionInterface; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Permission\PermissionInterface; class SimpleAssertion implements AssertionInterface { diff --git a/test/ConfigProviderTest.php b/test/ConfigProviderTest.php index 25dfd3d..fa469ba 100644 --- a/test/ConfigProviderTest.php +++ b/test/ConfigProviderTest.php @@ -21,11 +21,11 @@ namespace LmcRbacTest; -use LmcRbac\ConfigProvider; +use Lmc\Rbac\ConfigProvider; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\ConfigProvider + * @covers \Lmc\Rbac\ConfigProvider */ class ConfigProviderTest extends TestCase { @@ -34,13 +34,13 @@ public function testProvidesExpectedConfiguration() $provider = new ConfigProvider(); $expected = [ 'factories' => [ - \LmcRbac\Assertion\AssertionPluginManager::class => \LmcRbac\Assertion\AssertionPluginManagerFactory::class, - \LmcRbac\Options\ModuleOptions::class => \LmcRbac\Options\ModuleOptionsFactory::class, - \LmcRbac\Role\InMemoryRoleProvider::class => \LmcRbac\Role\InMemoryRoleProviderFactory::class, - \LmcRbac\Role\ObjectRepositoryRoleProvider::class => \LmcRbac\Role\ObjectRepositoryRoleProviderFactory::class, - \LmcRbac\Service\AuthorizationServiceInterface::class => \LmcRbac\Service\AuthorizationServiceFactory::class, - \LmcRbac\Service\RoleServiceInterface::class => \LmcRbac\Service\RoleServiceFactory::class, - \LmcRbac\Rbac::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, + \Lmc\Rbac\Assertion\AssertionPluginManager::class => \Lmc\Rbac\Assertion\AssertionPluginManagerFactory::class, + \Lmc\Rbac\Options\ModuleOptions::class => \Lmc\Rbac\Options\ModuleOptionsFactory::class, + \Lmc\Rbac\Role\InMemoryRoleProvider::class => \Lmc\Rbac\Role\InMemoryRoleProviderFactory::class, + \Lmc\Rbac\Role\ObjectRepositoryRoleProvider::class => \Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory::class, + \Lmc\Rbac\Service\AuthorizationServiceInterface::class => \Lmc\Rbac\Service\AuthorizationServiceFactory::class, + \Lmc\Rbac\Service\RoleServiceInterface::class => \Lmc\Rbac\Service\RoleServiceFactory::class, + \Lmc\Rbac\Rbac::class => \Laminas\ServiceManager\Factory\InvokableFactory::class, ], ]; $this->assertEquals($expected, $provider->getDependencyConfig()); diff --git a/test/Container/AssertionPluginManagerFactoryTest.php b/test/Container/AssertionPluginManagerFactoryTest.php index 44d299c..3e1824a 100644 --- a/test/Container/AssertionPluginManagerFactoryTest.php +++ b/test/Container/AssertionPluginManagerFactoryTest.php @@ -22,14 +22,14 @@ namespace LmcRbacTest\Container; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Assertion\AssertionContainer; -use LmcRbac\Assertion\AssertionContainerFactory; -use LmcRbac\Assertion\AssertionPluginManager; -use LmcRbac\Assertion\AssertionPluginManagerFactory; +use Lmc\Rbac\Assertion\AssertionContainer; +use Lmc\Rbac\Assertion\AssertionContainerFactory; +use Lmc\Rbac\Assertion\AssertionPluginManager; +use Lmc\Rbac\Assertion\AssertionPluginManagerFactory; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Assertion\AssertionPluginManagerFactory + * @covers \Lmc\Rbac\Assertion\AssertionPluginManagerFactory */ class AssertionPluginManagerFactoryTest extends TestCase { diff --git a/test/Container/AuthorizationServiceFactoryTest.php b/test/Container/AuthorizationServiceFactoryTest.php index 9ab0dac..2c8cc3d 100644 --- a/test/Container/AuthorizationServiceFactoryTest.php +++ b/test/Container/AuthorizationServiceFactoryTest.php @@ -21,20 +21,20 @@ namespace LmcRbacTest\Container; -use LmcRbac\Assertion\AssertionContainerInterface; -use LmcRbac\Assertion\AssertionPluginManager; -use LmcRbac\Assertion\AssertionPluginManagerInterface; -use LmcRbac\Service\AuthorizationServiceFactory; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Rbac; -use LmcRbac\Service\AuthorizationService; -use LmcRbac\Service\RoleServiceInterface; +use Lmc\Rbac\Assertion\AssertionContainerInterface; +use Lmc\Rbac\Assertion\AssertionPluginManager; +use Lmc\Rbac\Assertion\AssertionPluginManagerInterface; +use Lmc\Rbac\Service\AuthorizationServiceFactory; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Rbac; +use Lmc\Rbac\Service\AuthorizationService; +use Lmc\Rbac\Service\RoleServiceInterface; use PHPUnit\Framework\TestCase; use Prophecy\PhpUnit\ProphecyTrait; use Psr\Container\ContainerInterface; /** - * @covers \LmcRbac\Service\AuthorizationServiceFactory + * @covers \Lmc\Rbac\Service\AuthorizationServiceFactory */ class AuthorizationServiceFactoryTest extends TestCase { diff --git a/test/Container/InMemoryRoleProviderFactoryTest.php b/test/Container/InMemoryRoleProviderFactoryTest.php index 8f6c5ba..8e3a8e9 100644 --- a/test/Container/InMemoryRoleProviderFactoryTest.php +++ b/test/Container/InMemoryRoleProviderFactoryTest.php @@ -22,13 +22,13 @@ namespace LmcRbacTest\Container; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Role\InMemoryRoleProviderFactory; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Role\InMemoryRoleProviderFactory; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Role\InMemoryRoleProvider; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Role\InMemoryRoleProviderFactory + * @covers \Lmc\Rbac\Role\InMemoryRoleProviderFactory */ class InMemoryRoleProviderFactoryTest extends TestCase { diff --git a/test/Container/ModuleOptionsFactoryTest.php b/test/Container/ModuleOptionsFactoryTest.php index dd4a7bb..5ceafb7 100644 --- a/test/Container/ModuleOptionsFactoryTest.php +++ b/test/Container/ModuleOptionsFactoryTest.php @@ -22,12 +22,12 @@ namespace LmcRbacTest\Container; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Options\ModuleOptionsFactory; -use LmcRbac\Options\ModuleOptions; +use Lmc\Rbac\Options\ModuleOptionsFactory; +use Lmc\Rbac\Options\ModuleOptions; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Options\ModuleOptionsFactory + * @covers \Lmc\Rbac\Options\ModuleOptionsFactory */ class ModuleOptionsFactoryTest extends TestCase { diff --git a/test/Container/ObjectRepositoryRoleProviderFactoryTest.php b/test/Container/ObjectRepositoryRoleProviderFactoryTest.php index b6adf98..fc9e976 100644 --- a/test/Container/ObjectRepositoryRoleProviderFactoryTest.php +++ b/test/Container/ObjectRepositoryRoleProviderFactoryTest.php @@ -24,14 +24,14 @@ use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectRepository; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Role\ObjectRepositoryRoleProviderFactory; -use LmcRbac\Exception\RuntimeException; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Role\ObjectRepositoryRoleProvider; +use Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory; +use Lmc\Rbac\Exception\RuntimeException; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Role\ObjectRepositoryRoleProvider; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Role\ObjectRepositoryRoleProviderFactory + * @covers \Lmc\Rbac\Role\ObjectRepositoryRoleProviderFactory */ class ObjectRepositoryRoleProviderFactoryTest extends TestCase { diff --git a/test/Container/RoleServiceFactoryTest.php b/test/Container/RoleServiceFactoryTest.php index bdf09d4..38333c4 100644 --- a/test/Container/RoleServiceFactoryTest.php +++ b/test/Container/RoleServiceFactoryTest.php @@ -22,14 +22,14 @@ namespace LmcRbacTest\Container; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Options\ModuleOptions; -use LmcRbac\Role\InMemoryRoleProvider; -use LmcRbac\Service\RoleService; -use LmcRbac\Service\RoleServiceFactory; +use Lmc\Rbac\Options\ModuleOptions; +use Lmc\Rbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Service\RoleService; +use Lmc\Rbac\Service\RoleServiceFactory; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Service\RoleServiceFactory + * @covers \Lmc\Rbac\Service\RoleServiceFactory */ class RoleServiceFactoryTest extends TestCase { @@ -38,7 +38,7 @@ public function testCanCreateRoleService(): void $options = new ModuleOptions([ 'guest_role' => 'guest', 'role_provider' => [ - \LmcRbac\Role\InMemoryRoleProvider::class => [ + \Lmc\Rbac\Role\InMemoryRoleProvider::class => [ 'foo', ], ], @@ -54,7 +54,7 @@ public function testCanCreateRoleService(): void $factory = new RoleServiceFactory(); $roleService = $factory($container, RoleService::class); - $this->assertInstanceOf(\LmcRbac\Service\RoleService::class, $roleService); + $this->assertInstanceOf(\Lmc\Rbac\Service\RoleService::class, $roleService); } public function testThrowExceptionIfNoRoleProvider(): void diff --git a/test/ModuleTest.php b/test/ModuleTest.php index 90bb7d3..40297cb 100644 --- a/test/ModuleTest.php +++ b/test/ModuleTest.php @@ -21,12 +21,12 @@ namespace LmcRbacTest; -use LmcRbac\ConfigProvider; -use LmcRbac\Module; +use Lmc\Rbac\ConfigProvider; +use Lmc\Rbac\Module; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Module + * @covers \Lmc\Rbac\Module */ class ModuleTest extends TestCase { diff --git a/test/Options/ModuleOptionsTest.php b/test/Options/ModuleOptionsTest.php index da1b2eb..89b7810 100644 --- a/test/Options/ModuleOptionsTest.php +++ b/test/Options/ModuleOptionsTest.php @@ -21,23 +21,23 @@ namespace LmcRbacTest\Options; -use LmcRbac\Options\ModuleOptions; +use Lmc\Rbac\Options\ModuleOptions; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Options\ModuleOptions + * @covers \Lmc\Rbac\Options\ModuleOptions */ class ModuleOptionsTest extends TestCase { public function testAssertModuleDefaultOptions(): void { - $moduleOptions = new \LmcRbac\Options\ModuleOptions(); + $moduleOptions = new \Lmc\Rbac\Options\ModuleOptions(); $this->assertEquals('guest', $moduleOptions->getGuestRole()); $this->assertIsArray($moduleOptions->getRoleProvider()); $this->assertIsArray($moduleOptions->getAssertionMap()); - $this->assertEquals('LmcRbac\Role\InMemoryRoleProvider', key($moduleOptions->getRoleProvider())); - $this->assertEquals('LmcRbac\Identity\AuthenticationIdentityProvider', $moduleOptions->getIdentityProvider()); + $this->assertEquals('Lmc\Rbac\Role\InMemoryRoleProvider', key($moduleOptions->getRoleProvider())); + $this->assertEquals('Lmc\Rbac\Identity\AuthenticationIdentityProvider', $moduleOptions->getIdentityProvider()); } public function testSettersAndGetters(): void diff --git a/test/Rbac/RbacTest.php b/test/Rbac/RbacTest.php index bf6afee..6e5740f 100644 --- a/test/Rbac/RbacTest.php +++ b/test/Rbac/RbacTest.php @@ -21,18 +21,18 @@ namespace LmcRbacTest\Rbac; -use LmcRbac\Rbac; -use LmcRbac\Role\Role; +use Lmc\Rbac\Rbac; +use Lmc\Rbac\Role\Role; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Rbac + * @covers \Lmc\Rbac\Rbac * @group Coverage */ class RbacTest extends TestCase { /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testCanConvertSingleRole(): void { @@ -45,7 +45,7 @@ public function testCanConvertSingleRole(): void } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testCanUseEmptyArray(): void { @@ -54,7 +54,7 @@ public function testCanUseEmptyArray(): void } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testCanCheckMultipleRolesWithMatchingPermission(): void { @@ -70,7 +70,7 @@ public function testCanCheckMultipleRolesWithMatchingPermission(): void } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testReturnFalseIfNoRoleHasPermission(): void { @@ -78,13 +78,13 @@ public function testReturnFalseIfNoRoleHasPermission(): void $role2 = new Role('Bar'); $roles = [$role1, $role2]; - $rbac = new \LmcRbac\Rbac(); + $rbac = new \Lmc\Rbac\Rbac(); $this->assertFalse($rbac->isGranted($roles, 'permission')); } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testCanCheckHierarchicalRole(): void { @@ -94,13 +94,13 @@ public function testCanCheckHierarchicalRole(): void $parentRole = new Role('Foo'); $parentRole->addChild($childRole); - $rbac = new \LmcRbac\Rbac(); + $rbac = new \Lmc\Rbac\Rbac(); $this->assertTrue($rbac->isGranted($parentRole, 'permission')); } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testReturnFalseIfNoHierarchicalRoleHasPermission(): void { @@ -115,7 +115,7 @@ public function testReturnFalseIfNoHierarchicalRoleHasPermission(): void } /** - * @covers \LmcRbac\Rbac::isGranted + * @covers \Lmc\Rbac\Rbac::isGranted */ public function testCanCheckTraversableAsRolesList(): void { diff --git a/test/Role/InMemoryRoleProviderTest.php b/test/Role/InMemoryRoleProviderTest.php index 7d92fce..e2d9ba5 100644 --- a/test/Role/InMemoryRoleProviderTest.php +++ b/test/Role/InMemoryRoleProviderTest.php @@ -21,12 +21,12 @@ namespace LmcRbacTest\Role; -use LmcRbac\Role\InMemoryRoleProvider; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Role\RoleInterface; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Role\InMemoryRoleProvider + * @covers \Lmc\Rbac\Role\InMemoryRoleProvider */ class InMemoryRoleProviderTest extends TestCase { diff --git a/test/Role/ObjectRepositoryRoleProviderTest.php b/test/Role/ObjectRepositoryRoleProviderTest.php index 1e13e44..c9a9a50 100644 --- a/test/Role/ObjectRepositoryRoleProviderTest.php +++ b/test/Role/ObjectRepositoryRoleProviderTest.php @@ -27,13 +27,13 @@ use Doctrine\ORM\Tools\SchemaTool; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectRepository; -use LmcRbac\Role\ObjectRepositoryRoleProvider; -use LmcRbac\Role\Role; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Role\ObjectRepositoryRoleProvider; +use Lmc\Rbac\Role\Role; +use Lmc\Rbac\Role\RoleInterface; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Role\ObjectRepositoryRoleProvider + * @covers \Lmc\Rbac\Role\ObjectRepositoryRoleProvider */ class ObjectRepositoryRoleProviderTest extends TestCase { @@ -107,7 +107,7 @@ public function testThrowExceptionIfAskedRoleIsNotFound(): void $objectRepository->expects($this->once())->method('findBy')->willReturn($result); - $this->expectException('LmcRbac\Exception\RoleNotFoundException'); + $this->expectException('Lmc\Rbac\Exception\RoleNotFoundException'); $this->expectExceptionMessage('Some roles were asked but could not be loaded from database: guest, admin'); $provider->getRoles(['guest', 'admin', 'member']); @@ -172,7 +172,7 @@ public function testObjectRepositoryProviderForFlatRoleWithPermissions() $this->assertCount(1, $roles); $this->assertIsArray($roles); - $this->assertInstanceOf('LmcRbac\Role\RoleInterface', $roles[0]); + $this->assertInstanceOf('Lmc\Rbac\Role\RoleInterface', $roles[0]); $this->assertEquals('admin', $roles[0]->getName()); $this->assertTrue($roles[0]->hasPermission('manage')); $this->assertTrue($roles[0]->hasPermission('read')); @@ -208,13 +208,13 @@ public function testObjectRepositoryProviderForHierarchicalRole() $this->assertCount(1, $roles); $this->assertIsArray($roles); - $this->assertInstanceOf('LmcRbac\Role\RoleInterface', $roles[0]); + $this->assertInstanceOf('Lmc\Rbac\Role\RoleInterface', $roles[0]); $this->assertEquals('admin', $roles[0]->getName()); $childRolesString = ''; foreach ($this->flattenRoles($roles[0]->getChildren()) as $childRole) { - $this->assertInstanceOf('LmcRbac\Role\RoleInterface', $childRole); + $this->assertInstanceOf('Lmc\Rbac\Role\RoleInterface', $childRole); $childRolesString .= $childRole->getName(); } diff --git a/test/Role/RoleTest.php b/test/Role/RoleTest.php index f9d26ae..5795c87 100644 --- a/test/Role/RoleTest.php +++ b/test/Role/RoleTest.php @@ -21,12 +21,12 @@ namespace LmcRbacTest\Role; -use LmcRbac\Role\Role; -use LmcRbac\Role\RoleInterface; +use Lmc\Rbac\Role\Role; +use Lmc\Rbac\Role\RoleInterface; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Role\Role + * @covers \Lmc\Rbac\Role\Role * @group Coverage */ class RoleTest extends TestCase @@ -38,7 +38,7 @@ public function testSetNameByConstructor(): void } /** - * @covers \LmcRbac\Role\Role::addPermission + * @covers \Lmc\Rbac\Role\Role::addPermission */ public function testRoleCanAddPermission(): void { @@ -53,7 +53,7 @@ public function testRoleCanAddPermission(): void } /** - * @covers \LmcRbac\Role\Role::getPermissions + * @covers \Lmc\Rbac\Role\Role::getPermissions */ public function testRoleCanGetPermissions(): void { @@ -70,7 +70,7 @@ public function testRoleCanGetPermissions(): void } /** - * @covers \LmcRbac\Role\Role::hasPermission + * @covers \Lmc\Rbac\Role\Role::hasPermission */ public function testHasPermission(): void { @@ -88,7 +88,7 @@ public function testHasPermission(): void } /** - * @covers \LmcRbac\Role\Role::addChild + * @covers \Lmc\Rbac\Role\Role::addChild */ public function testCanAddChild(): void { @@ -101,7 +101,7 @@ public function testCanAddChild(): void } /** - * @covers \LmcRbac\Role\Role::hasChildren + * @covers \Lmc\Rbac\Role\Role::hasChildren */ public function testHasChildren(): void { @@ -115,7 +115,7 @@ public function testHasChildren(): void } /** - * @covers \LmcRbac\Role\Role::getChildren + * @covers \Lmc\Rbac\Role\Role::getChildren */ public function testCanGetChildren(): void { diff --git a/test/Service/AuthorizationServiceAwareTraitTest.php b/test/Service/AuthorizationServiceAwareTraitTest.php index e080d04..a466a62 100644 --- a/test/Service/AuthorizationServiceAwareTraitTest.php +++ b/test/Service/AuthorizationServiceAwareTraitTest.php @@ -22,7 +22,7 @@ * @author Eric Richer */ -use LmcRbac\Service\AuthorizationServiceInterface; +use Lmc\Rbac\Service\AuthorizationServiceInterface; use PHPUnit\Framework\TestCase; class AuthorizationServiceAwareTraitTest extends TestCase diff --git a/test/Service/AuthorizationServiceDelegatorFactoryTest.php b/test/Service/AuthorizationServiceDelegatorFactoryTest.php index e5a3fa7..94d985a 100644 --- a/test/Service/AuthorizationServiceDelegatorFactoryTest.php +++ b/test/Service/AuthorizationServiceDelegatorFactoryTest.php @@ -24,8 +24,8 @@ use Laminas\ServiceManager\Exception\ServiceNotCreatedException; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Service\AuthorizationServiceDelegatorFactory; -use LmcRbac\Service\AuthorizationServiceInterface; +use Lmc\Rbac\Service\AuthorizationServiceDelegatorFactory; +use Lmc\Rbac\Service\AuthorizationServiceInterface; use PHPUnit\Framework\TestCase; use Prophecy\PhpUnit\ProphecyTrait; use Psr\Container\ContainerInterface; diff --git a/test/Service/AuthorizationServiceTest.php b/test/Service/AuthorizationServiceTest.php index d2a89c0..483f1b5 100644 --- a/test/Service/AuthorizationServiceTest.php +++ b/test/Service/AuthorizationServiceTest.php @@ -22,26 +22,26 @@ namespace LmcRbacTest\Service; use Laminas\ServiceManager\ServiceManager; -use LmcRbac\Assertion\AssertionPluginManager; -use LmcRbac\Assertion\AssertionPluginManagerInterface; -use LmcRbac\Assertion\AssertionSet; -use LmcRbac\Exception\InvalidArgumentException; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Identity\IdentityProviderInterface; -use LmcRbac\Rbac; -use LmcRbac\RbacInterface; -use LmcRbac\Role\InMemoryRoleProvider; -use LmcRbac\Role\Role; -use LmcRbac\Role\RoleInterface; -use LmcRbac\Service\AuthorizationService; -use LmcRbac\Service\RoleService; -use LmcRbac\Service\RoleServiceInterface; +use Lmc\Rbac\Assertion\AssertionPluginManager; +use Lmc\Rbac\Assertion\AssertionPluginManagerInterface; +use Lmc\Rbac\Assertion\AssertionSet; +use Lmc\Rbac\Exception\InvalidArgumentException; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Identity\IdentityProviderInterface; +use Lmc\Rbac\Rbac; +use Lmc\Rbac\RbacInterface; +use Lmc\Rbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Role\Role; +use Lmc\Rbac\Role\RoleInterface; +use Lmc\Rbac\Service\AuthorizationService; +use Lmc\Rbac\Service\RoleService; +use Lmc\Rbac\Service\RoleServiceInterface; use LmcRbacTest\Asset\Identity; use LmcRbacTest\Asset\SimpleAssertion; use PHPUnit\Framework\TestCase; /** - * @covers \LmcRbac\Service\AuthorizationService + * @covers \Lmc\Rbac\Service\AuthorizationService */ class AuthorizationServiceTest extends TestCase { diff --git a/test/Service/DummyAuthorizationServiceClass.php b/test/Service/DummyAuthorizationServiceClass.php index 4cb589a..3054f2e 100644 --- a/test/Service/DummyAuthorizationServiceClass.php +++ b/test/Service/DummyAuthorizationServiceClass.php @@ -22,8 +22,8 @@ * @author Eric Richer */ -use LmcRbac\Service\AuthorizationServiceAwareInterface; -use LmcRbac\Service\AuthorizationServiceAwareTrait; +use Lmc\Rbac\Service\AuthorizationServiceAwareInterface; +use Lmc\Rbac\Service\AuthorizationServiceAwareTrait; class DummyAuthorizationServiceClass implements AuthorizationServiceAwareInterface { diff --git a/test/Service/RoleServiceTest.php b/test/Service/RoleServiceTest.php index d26a614..4c50b53 100644 --- a/test/Service/RoleServiceTest.php +++ b/test/Service/RoleServiceTest.php @@ -21,19 +21,19 @@ namespace LmcRbacTest\Service; -use LmcRbac\Identity\IdentityInterface; -use LmcRbac\Role\InMemoryRoleProvider; -use LmcRbac\Role\Role; -use LmcRbac\Role\RoleInterface; -use LmcRbac\Role\RoleProviderInterface; -use LmcRbac\Service\RoleService; +use Lmc\Rbac\Identity\IdentityInterface; +use Lmc\Rbac\Role\InMemoryRoleProvider; +use Lmc\Rbac\Role\Role; +use Lmc\Rbac\Role\RoleInterface; +use Lmc\Rbac\Role\RoleProviderInterface; +use Lmc\Rbac\Service\RoleService; use LmcRbacTest\Asset\Identity; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; /** - * @covers \LmcRbac\Service\RoleService + * @covers \Lmc\Rbac\Service\RoleService */ class RoleServiceTest extends TestCase { From 782c83b157317c007f63e3892c9c7b0be6e4d3a9 Mon Sep 17 00:00:00 2001 From: Eric Richer Date: Tue, 6 Aug 2024 11:26:41 -0400 Subject: [PATCH 03/10] Update renovate.json to run againts master and 2.x (cherry picked from commit 3de3c0c070352c1fe46c5cbcc641bca726f44abb) --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 5db72dd..b2ccae1 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,6 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:recommended" - ] + ], + "baseBranches": ["master", "2.x"] } From 3070cdeafc5423aac416828d06a47258240491e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:07:17 +0000 Subject: [PATCH 04/10] Bump braces from 3.0.2 to 3.0.3 in /docs Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] (cherry picked from commit 48a7134d6e7b8bc9a6005863954eb577674e1a85) --- docs/yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index 3312599..27c1785 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -3063,11 +3063,11 @@ brace-expansion@^1.1.7: concat-map "0.0.1" braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" browserslist@^4.0.0, browserslist@^4.18.1, browserslist@^4.21.10, browserslist@^4.22.2, browserslist@^4.23.0: version "4.23.0" @@ -4300,10 +4300,10 @@ filesize@^8.0.6: resolved "https://registry.yarnpkg.com/filesize/-/filesize-8.0.7.tgz#695e70d80f4e47012c132d57a059e80c6b580bd8" integrity sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ== -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" From 813729659c2df40eecb78b64e16629ad8bc8e6b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:07:33 +0000 Subject: [PATCH 05/10] Bump ws from 7.5.9 to 7.5.10 in /docs Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] (cherry picked from commit 9157ad1c1a70f3ce5b9b2084f641c1c765ecbba3) --- docs/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index 27c1785..23b60b7 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -8607,14 +8607,14 @@ write-file-atomic@^3.0.3: typedarray-to-buffer "^3.1.5" ws@^7.3.1: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@^8.13.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" - integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== xdg-basedir@^5.0.1, xdg-basedir@^5.1.0: version "5.1.0" From dc64860a73b5cd68cb63507cb9de60935da0907e Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Tue, 6 Aug 2024 14:16:44 -0400 Subject: [PATCH 06/10] Added guest role setter and getter Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- src/Service/RoleService.php | 21 +++++++++++++++++++++ test/Service/RoleServiceTest.php | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Service/RoleService.php b/src/Service/RoleService.php index 316298f..a0dd4e3 100644 --- a/src/Service/RoleService.php +++ b/src/Service/RoleService.php @@ -46,6 +46,27 @@ public function __construct( $this->guestRole = $guestRole; } + /** + * Set the guest role + * + * @param string $guestRole + * @return void + */ + public function setGuestRole(string $guestRole): void + { + $this->guestRole = $guestRole; + } + + /** + * Get the guest role + * + * @return string + */ + public function getGuestRole(): string + { + return $this->guestRole; + } + /** * Get the identity roles from the current identity, applying some more logic * diff --git a/test/Service/RoleServiceTest.php b/test/Service/RoleServiceTest.php index 4c50b53..46f4157 100644 --- a/test/Service/RoleServiceTest.php +++ b/test/Service/RoleServiceTest.php @@ -110,4 +110,13 @@ public function testWillCollectRolesOnlyIfRequired(): void $this->assertEquals($roles[1]->getName(), $result[1]->getName()); $this->assertEquals($roles[2], $result[2]->getName()); } + + public function testGuestRoleSetterGetter(): void + { + $roleService = new RoleService(new InMemoryRoleProvider([]), 'guest'); + $this->assertEquals('guest', $roleService->getGuestRole()); + + $roleService->setGuestRole('foo'); + $this->assertEquals('foo', $roleService->getGuestRole()); + } } From 97f4d8ec5156ad0d05472f39e343fbc18ca8f44b Mon Sep 17 00:00:00 2001 From: Eric Richer Date: Tue, 6 Aug 2024 17:20:44 -0400 Subject: [PATCH 07/10] Update renovate.json to ignore phpunit v11 (cherry picked from commit 7ce3b10472f950b1e9eb203168c5e85fa6af5d7a) --- renovate.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index b2ccae1..c55fa5b 100644 --- a/renovate.json +++ b/renovate.json @@ -3,5 +3,11 @@ "extends": [ "config:recommended" ], - "baseBranches": ["master", "2.x"] + "baseBranches": ["master", "2.x"], + "packageRules": [ + { + "matchPackageNames": ["phpunit/phpunit"], + "allowedVersions": "<=11.0" + } + ] } From 8d76939b8a18edb8701612fda5d3064696ff9215 Mon Sep 17 00:00:00 2001 From: Eric Richer Date: Tue, 6 Aug 2024 17:24:56 -0400 Subject: [PATCH 08/10] Update renovate.json to ignore phpunit v11 (cherry picked from commit 962e9c5bbd80c9cad07b6a65e72cfc60af894896) --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index c55fa5b..8f151a8 100644 --- a/renovate.json +++ b/renovate.json @@ -7,7 +7,7 @@ "packageRules": [ { "matchPackageNames": ["phpunit/phpunit"], - "allowedVersions": "<=11.0" + "allowedVersions": "<11.0" } ] } From b40e8af134474b060270783b0d4e0f2d43105d0f Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Wed, 7 Aug 2024 08:54:42 -0400 Subject: [PATCH 09/10] Fixed type declaration Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- src/Role/InMemoryRoleProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Role/InMemoryRoleProvider.php b/src/Role/InMemoryRoleProvider.php index 0deb277..256df12 100644 --- a/src/Role/InMemoryRoleProvider.php +++ b/src/Role/InMemoryRoleProvider.php @@ -44,7 +44,7 @@ final class InMemoryRoleProvider implements RoleProviderInterface /** * @var array */ - private $rolesConfig = []; + private array $rolesConfig = []; /** * @param array $rolesConfig From cebce6ec2b5050a833627d83134472bc09eb4108 Mon Sep 17 00:00:00 2001 From: "Eric Richer eric.richer@vistoconsulting.com" Date: Wed, 7 Aug 2024 08:59:28 -0400 Subject: [PATCH 10/10] Fixed dependency syntax Signed-off-by: Eric Richer eric.richer@vistoconsulting.com --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 790d953..04ff401 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "friendsofphp/php-cs-fixer": "^3.43", "php-coveralls/php-coveralls": "^2.0", "doctrine/orm": "^2.13 | ^3.0", - "symfony/cache": "^4.0| ^5.0 |^6.0" + "symfony/cache": "^4.0 | ^5.0 | ^6.0" }, "autoload": { "psr-4": {