From c706946a974b1a9cd3f2976e6acfdbd4291db180 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 15 Jan 2023 00:38:44 +0000 Subject: [PATCH 1/7] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/composer.lock b/composer.lock index c95e371..63f2a23 100644 --- a/composer.lock +++ b/composer.lock @@ -280,16 +280,16 @@ }, { "name": "mezzio/mezzio-router", - "version": "3.10.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-router.git", - "reference": "f98d3e97b0e949d394703e526bf218402be601bf" + "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/f98d3e97b0e949d394703e526bf218402be601bf", - "reference": "f98d3e97b0e949d394703e526bf218402be601bf", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/a30bb059261e6d1d980bcd35b4f8ed537cf8087f", + "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f", "shasum": "" }, "require": { @@ -306,12 +306,12 @@ "zendframework/zend-expressive-router": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-diactoros": "^2.20.0", + "laminas/laminas-coding-standard": "~2.5.0", + "laminas/laminas-diactoros": "^2.24", "laminas/laminas-stratigility": "^3.9.0", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "phpunit/phpunit": "^9.5.27", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.4" }, "suggest": { "mezzio/mezzio-aurarouter": "^3.0 to use the Aura.Router routing adapter", @@ -357,7 +357,7 @@ "type": "community_bridge" } ], - "time": "2022-12-13T20:50:07+00:00" + "time": "2023-01-12T15:10:48+00:00" }, { "name": "psr/container", @@ -2620,20 +2620,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.27", + "version": "9.5.28", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/954ca3113a03bf780d22f07bf055d883ee04b65e", + "reference": "954ca3113a03bf780d22f07bf055d883ee04b65e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -2702,7 +2702,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.28" }, "funding": [ { @@ -2718,7 +2718,7 @@ "type": "tidelift" } ], - "time": "2022-12-09T07:31:23+00:00" + "time": "2023-01-14T12:32:24+00:00" }, { "name": "psalm/plugin-phpunit", From b6ec2779e6ae3b14550f86253a7528e4e32a3b62 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 11:59:03 +0000 Subject: [PATCH 2/7] Fix psalm issue, add void type hints, replace prophecy with phpunit mocks Signed-off-by: George Steel --- test/LaminasRbacTest.php | 152 ++++++++++++++++++++++----------------- 1 file changed, 86 insertions(+), 66 deletions(-) diff --git a/test/LaminasRbacTest.php b/test/LaminasRbacTest.php index d4d07bc..3ecf925 100644 --- a/test/LaminasRbacTest.php +++ b/test/LaminasRbacTest.php @@ -10,131 +10,151 @@ use Mezzio\Authorization\Rbac\LaminasRbacAssertionInterface; use Mezzio\Router\Route; use Mezzio\Router\RouteResult; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; -use Prophecy\Prophecy\ObjectProphecy; use Psr\Http\Message\ServerRequestInterface; class LaminasRbacTest extends TestCase { - use ProphecyTrait; + /** @var Rbac&MockObject */ + private Rbac $rbac; - /** @var Rbac|ObjectProphecy */ - private $rbac; - - /** @var LaminasRbacAssertionInterface|ObjectProphecy */ - private $assertion; + /** @var LaminasRbacAssertionInterface&MockObject */ + private LaminasRbacAssertionInterface $assertion; protected function setUp(): void { - $this->rbac = $this->prophesize(Rbac::class); - $this->assertion = $this->prophesize(LaminasRbacAssertionInterface::class); + $this->rbac = $this->createMock(Rbac::class); + $this->assertion = $this->createMock(LaminasRbacAssertionInterface::class); } - public function testConstructorWithoutAssertion() + public function testConstructorWithoutAssertion(): void { - $laminasRbac = new LaminasRbac($this->rbac->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = new LaminasRbac($this->rbac); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testConstructorWithAssertion() + public function testConstructorWithAssertion(): void { - $laminasRbac = new LaminasRbac($this->rbac->reveal(), $this->assertion->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = new LaminasRbac($this->rbac, $this->assertion); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testIsGrantedWithoutRouteResult() + public function testIsGrantedWithoutRouteResult(): void { - $laminasRbac = new LaminasRbac($this->rbac->reveal(), $this->assertion->reveal()); + $laminasRbac = new LaminasRbac($this->rbac, $this->assertion); - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn(false); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn(false); $this->expectException(Exception\RuntimeException::class); - $laminasRbac->isGranted('foo', $request->reveal()); + $laminasRbac->isGranted('foo', $request); } - public function testIsGrantedWithoutAssertion() + public function testIsGrantedWithoutAssertion(): void { - $this->rbac->isGranted('foo', 'home', null)->willReturn(true); - $laminasRbac = new LaminasRbac($this->rbac->reveal()); + $this->rbac->expects(self::once()) + ->method('isGranted') + ->with('foo', 'home', null) + ->willReturn(true); - $routeResult = $this->getSuccessRouteResult('home'); + $laminasRbac = new LaminasRbac($this->rbac); - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn($routeResult); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn($this->getSuccessRouteResult('home')); - $result = $laminasRbac->isGranted('foo', $request->reveal()); - $this->assertTrue($result); + $result = $laminasRbac->isGranted('foo', $request); + self::assertTrue($result); } - public function testIsNotGrantedWithoutAssertion() + public function testIsNotGrantedWithoutAssertion(): void { - $this->rbac->isGranted('foo', 'home', null)->willReturn(false); - $laminasRbac = new LaminasRbac($this->rbac->reveal()); + $this->rbac->expects(self::once()) + ->method('isGranted') + ->with('foo', 'home', null) + ->willReturn(false); - $routeResult = $this->getSuccessRouteResult('home'); + $laminasRbac = new LaminasRbac($this->rbac); - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn($routeResult); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn($this->getSuccessRouteResult('home')); - $result = $laminasRbac->isGranted('foo', $request->reveal()); - $this->assertFalse($result); + $result = $laminasRbac->isGranted('foo', $request); + self::assertFalse($result); } - public function testIsGrantedWitAssertion() + public function testIsGrantedWitAssertion(): void { - $routeResult = $this->getSuccessRouteResult('home'); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn($this->getSuccessRouteResult('home')); - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn($routeResult); + $this->rbac->expects(self::once()) + ->method('isGranted') + ->with('foo', 'home', $this->assertion) + ->willReturn(true); - $this->rbac->isGranted('foo', 'home', $this->assertion->reveal())->willReturn(true); + $this->assertion->expects(self::once()) + ->method('setRequest') + ->with($request); - $laminasRbac = new LaminasRbac($this->rbac->reveal(), $this->assertion->reveal()); + $laminasRbac = new LaminasRbac($this->rbac, $this->assertion); - $result = $laminasRbac->isGranted('foo', $request->reveal()); - $this->assertTrue($result); - $this->assertion->setRequest($request->reveal())->shouldBeCalled(); + $result = $laminasRbac->isGranted('foo', $request); + self::assertTrue($result); } - public function testIsNotGrantedWitAssertion() + public function testIsNotGrantedWitAssertion(): void { - $routeResult = $this->getSuccessRouteResult('home'); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn($this->getSuccessRouteResult('home')); - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn($routeResult); + $this->rbac->expects(self::once()) + ->method('isGranted') + ->with('foo', 'home', $this->assertion) + ->willReturn(false); - $this->rbac->isGranted('foo', 'home', $this->assertion->reveal())->willReturn(false); + $this->assertion->expects(self::once()) + ->method('setRequest') + ->with($request); - $laminasRbac = new LaminasRbac($this->rbac->reveal(), $this->assertion->reveal()); + $laminasRbac = new LaminasRbac($this->rbac, $this->assertion); - $result = $laminasRbac->isGranted('foo', $request->reveal()); - $this->assertFalse($result); - $this->assertion->setRequest($request->reveal())->shouldBeCalled(); + $result = $laminasRbac->isGranted('foo', $request); + self::assertFalse($result); } - public function testIsGrantedWithFailedRouting() + public function testIsGrantedWithFailedRouting(): void { - $routeResult = $this->getFailureRouteResult(Route::HTTP_METHOD_ANY); - - $request = $this->prophesize(ServerRequestInterface::class); - $request->getAttribute(RouteResult::class, false)->willReturn($routeResult); + $request = $this->createMock(ServerRequestInterface::class); + $request->method('getAttribute') + ->with(RouteResult::class, false) + ->willReturn($this->getFailureRouteResult(Route::HTTP_METHOD_ANY)); - $laminasRbac = new LaminasRbac($this->rbac->reveal()); + $laminasRbac = new LaminasRbac($this->rbac); - $result = $laminasRbac->isGranted('foo', $request->reveal()); - $this->assertTrue($result); + $result = $laminasRbac->isGranted('foo', $request); + self::assertTrue($result); } private function getSuccessRouteResult(string $routeName): RouteResult { - $route = $this->prophesize(Route::class); - $route->getName()->willReturn($routeName); + $route = $this->createMock(Route::class); + $route->method('getName')->willReturn($routeName); - return RouteResult::fromRoute($route->reveal()); + return RouteResult::fromRoute($route); } + /** @param list|null $methods */ private function getFailureRouteResult(?array $methods): RouteResult { return RouteResult::fromRouteFailure($methods); From 49c12ad489e45763ef8951d929e42edbada74dd9 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 12:20:26 +0000 Subject: [PATCH 3/7] Add void type hints, replace prophecy with phpunit mocks Signed-off-by: George Steel --- test/LaminasRbacFactoryTest.php | 134 +++++++++++++++++++------------- 1 file changed, 78 insertions(+), 56 deletions(-) diff --git a/test/LaminasRbacFactoryTest.php b/test/LaminasRbacFactoryTest.php index 9270a7b..db0a0c5 100644 --- a/test/LaminasRbacFactoryTest.php +++ b/test/LaminasRbacFactoryTest.php @@ -8,49 +8,45 @@ use Mezzio\Authorization\Rbac\LaminasRbac; use Mezzio\Authorization\Rbac\LaminasRbacAssertionInterface; use Mezzio\Authorization\Rbac\LaminasRbacFactory; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; -use Prophecy\Prophecy\ObjectProphecy; use Psr\Container\ContainerInterface; -use Zend\Expressive\Authorization\Rbac\ZendRbacAssertionInterface; class LaminasRbacFactoryTest extends TestCase { - use ProphecyTrait; - - /** @var ContainerInterface|ObjectProphecy */ - private $container; + /** @var ContainerInterface&MockObject */ + private ContainerInterface $container; protected function setUp(): void { - $this->container = $this->prophesize(ContainerInterface::class); + $this->container = $this->createMock(ContainerInterface::class); } - public function testFactoryWithoutConfig() + public function testFactoryWithoutConfig(): void { - $this->container->get('config')->willReturn([]); + $this->container->method('get')->with('config')->willReturn([]); $factory = new LaminasRbacFactory(); $this->expectException(Exception\InvalidConfigException::class); $this->expectExceptionMessage('mezzio-authorization-rbac'); - $factory($this->container->reveal()); + $factory($this->container); } - public function testFactoryWithoutLaminasRbacConfig() + public function testFactoryWithoutLaminasRbacConfig(): void { - $this->container->get('config')->willReturn(['mezzio-authorization-rbac' => []]); + $this->container->method('get')->with('config')->willReturn(['mezzio-authorization-rbac' => []]); $factory = new LaminasRbacFactory(); $this->expectException(Exception\InvalidConfigException::class); $this->expectExceptionMessage('mezzio-authorization-rbac.roles'); - $factory($this->container->reveal()); + $factory($this->container); } - public function testFactoryWithoutPermissions() + public function testFactoryWithoutPermissions(): void { - $this->container->get('config')->willReturn([ + $this->container->method('get')->with('config')->willReturn([ 'mezzio-authorization-rbac' => [ 'roles' => [], ], @@ -60,46 +56,55 @@ public function testFactoryWithoutPermissions() $this->expectException(Exception\InvalidConfigException::class); $this->expectExceptionMessage('mezzio-authorization-rbac.permissions'); - $factory($this->container->reveal()); + $factory($this->container); } - public function testFactoryWithEmptyRolesPermissionsWithoutAssertion() + public function testFactoryWithEmptyRolesPermissionsWithoutAssertion(): void { - $this->container->get('config')->willReturn([ + $this->container->method('get')->with('config')->willReturn([ 'mezzio-authorization-rbac' => [ 'roles' => [], 'permissions' => [], ], ]); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(false); - $this->container->has(ZendRbacAssertionInterface::class)->willReturn(false); + + $this->container->method('has') + ->withConsecutive( + [LaminasRbacAssertionInterface::class], + ['Zend\Expressive\Authorization\Rbac\ZendRbacAssertionInterface'] + )->willReturn(false, false); $factory = new LaminasRbacFactory(); - $laminasRbac = $factory($this->container->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = $factory($this->container); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testFactoryWithEmptyRolesPermissionsWithAssertion() + public function testFactoryWithEmptyRolesPermissionsWithAssertion(): void { - $this->container->get('config')->willReturn([ + $assertion = $this->createMock(LaminasRbacAssertionInterface::class); + $config = [ 'mezzio-authorization-rbac' => [ 'roles' => [], 'permissions' => [], ], - ]); + ]; - $assertion = $this->prophesize(LaminasRbacAssertionInterface::class); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(true); - $this->container->get(LaminasRbacAssertionInterface::class)->willReturn($assertion->reveal()); + $this->container->method('get') + ->willReturnMap([ + ['config', $config], + [LaminasRbacAssertionInterface::class, $assertion], + ]); + + $this->container->method('has')->with(LaminasRbacAssertionInterface::class)->willReturn(true); $factory = new LaminasRbacFactory(); - $laminasRbac = $factory($this->container->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = $factory($this->container); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testFactoryWithoutAssertion() + public function testFactoryWithoutAssertion(): void { - $this->container->get('config')->willReturn([ + $config = [ 'mezzio-authorization-rbac' => [ 'roles' => [ 'administrator' => [], @@ -119,18 +124,22 @@ public function testFactoryWithoutAssertion() ], ], ], - ]); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(false); - $this->container->has(ZendRbacAssertionInterface::class)->willReturn(false); + ]; + $this->container->method('get')->with('config')->willReturn($config); + $this->container->method('has') + ->withConsecutive( + [LaminasRbacAssertionInterface::class], + ['Zend\Expressive\Authorization\Rbac\ZendRbacAssertionInterface'], + )->willReturn(false, false); $factory = new LaminasRbacFactory(); - $laminasRbac = $factory($this->container->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = $factory($this->container); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testFactoryWithAssertion() + public function testFactoryWithAssertion(): void { - $this->container->get('config')->willReturn([ + $config = [ 'mezzio-authorization-rbac' => [ 'roles' => [ 'administrator' => [], @@ -150,19 +159,25 @@ public function testFactoryWithAssertion() ], ], ], - ]); - $assertion = $this->prophesize(LaminasRbacAssertionInterface::class); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(true); - $this->container->get(LaminasRbacAssertionInterface::class)->willReturn($assertion->reveal()); + ]; + $assertion = $this->createMock(LaminasRbacAssertionInterface::class); + + $this->container->method('has')->with(LaminasRbacAssertionInterface::class)->willReturn(true); + + $this->container->method('get') + ->willReturnMap([ + ['config', $config], + [LaminasRbacAssertionInterface::class, $assertion], + ]); $factory = new LaminasRbacFactory(); - $laminasRbac = $factory($this->container->reveal()); - $this->assertInstanceOf(LaminasRbac::class, $laminasRbac); + $laminasRbac = $factory($this->container); + self::assertInstanceOf(LaminasRbac::class, $laminasRbac); } - public function testFactoryWithInvalidRole() + public function testFactoryWithInvalidRole(): void { - $this->container->get('config')->willReturn([ + $this->container->method('get')->with('config')->willReturn([ 'mezzio-authorization-rbac' => [ 'roles' => [ 1 => [], @@ -170,18 +185,22 @@ public function testFactoryWithInvalidRole() 'permissions' => [], ], ]); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(false); - $this->container->has(ZendRbacAssertionInterface::class)->willReturn(false); + + $this->container->method('has') + ->withConsecutive([ + LaminasRbacAssertionInterface::class, + 'Zend\Expressive\Authorization\Rbac\ZendRbacAssertionInterface', + ])->willReturn(false, false); $factory = new LaminasRbacFactory(); $this->expectException(Exception\InvalidConfigException::class); - $factory($this->container->reveal()); + $factory($this->container); } - public function testFactoryWithUnknownRole() + public function testFactoryWithUnknownRole(): void { - $this->container->get('config')->willReturn([ + $this->container->method('get')->with('config')->willReturn([ 'mezzio-authorization-rbac' => [ 'roles' => [ 'administrator' => [], @@ -194,12 +213,15 @@ public function testFactoryWithUnknownRole() ], ], ]); - $this->container->has(LaminasRbacAssertionInterface::class)->willReturn(false); - $this->container->has(ZendRbacAssertionInterface::class)->willReturn(false); + $this->container->method('has') + ->withConsecutive([ + LaminasRbacAssertionInterface::class, + 'Zend\Expressive\Authorization\Rbac\ZendRbacAssertionInterface', + ])->willReturn(false, false); $factory = new LaminasRbacFactory(); $this->expectException(Exception\InvalidConfigException::class); - $factory($this->container->reveal()); + $factory($this->container); } } From 42f1fec86d8ed4cbb254bf4dd919eb8fd5ea0d16 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 12:21:44 +0000 Subject: [PATCH 4/7] Remove prophecy, bump dev deps, refresh lock Signed-off-by: George Steel --- composer.json | 10 ++-- composer.lock | 131 +++----------------------------------------------- 2 files changed, 10 insertions(+), 131 deletions(-) diff --git a/composer.json b/composer.json index 647eb47..511e307 100644 --- a/composer.json +++ b/composer.json @@ -43,12 +43,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-servicemanager": "^3.10", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0.1", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "laminas/laminas-servicemanager": "^3.20", + "phpunit/phpunit": "^9.5.28", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.4" }, "conflict": { "container-interop/container-interop": "<1.2.0", diff --git a/composer.lock b/composer.lock index 63f2a23..f6f954a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "12f604fc7a99740ef78d40af1f804664", + "content-hash": "dbeb71804f1d8081f1a56b0a3327ffcd", "packages": [ { "name": "fig/http-message-util", @@ -280,16 +280,16 @@ }, { "name": "mezzio/mezzio-router", - "version": "3.12.0", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-router.git", - "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f" + "reference": "cb9e2476844074587e1ed849f53ef466a7e8d893" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/a30bb059261e6d1d980bcd35b4f8ed537cf8087f", - "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/cb9e2476844074587e1ed849f53ef466a7e8d893", + "reference": "cb9e2476844074587e1ed849f53ef466a7e8d893", "shasum": "" }, "require": { @@ -357,7 +357,7 @@ "type": "community_bridge" } ], - "time": "2023-01-12T15:10:48+00:00" + "time": "2023-01-15T08:25:11+00:00" }, { "name": "psr/container", @@ -2137,125 +2137,6 @@ }, "time": "2022-10-14T12:47:21+00:00" }, - { - "name": "phpspec/prophecy", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" - }, - "time": "2022-11-29T15:06:56+00:00" - }, - { - "name": "phpspec/prophecy-phpunit", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/2d7a9df55f257d2cba9b1d0c0963a54960657177", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8", - "phpspec/prophecy": "^1.3", - "phpunit/phpunit": "^9.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\PhpUnit\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - } - ], - "description": "Integrating the Prophecy mocking library in PHPUnit test cases", - "homepage": "http://phpspec.net", - "keywords": [ - "phpunit", - "prophecy" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy-phpunit/issues", - "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.0.1" - }, - "time": "2020-07-09T08:33:42+00:00" - }, { "name": "phpstan/phpdoc-parser", "version": "1.5.1", From 04326bcd578bdce4a72afc9a0d6088d083a1f0ec Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 12:22:15 +0000 Subject: [PATCH 5/7] Stop ignoring platform reqs on 8.2 Signed-off-by: George Steel --- .laminas-ci.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.laminas-ci.json b/.laminas-ci.json index 89ee608..6f96f6d 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -1,5 +1,5 @@ { "ignore_php_platform_requirements": { - "8.2": true + "8.2": false } -} \ No newline at end of file +} From 71b5914a740a87f1d1e5443aeb4dcc11e04b42ac Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 12:22:24 +0000 Subject: [PATCH 6/7] Refresh baseline Signed-off-by: George Steel --- psalm-baseline.xml | 114 --------------------------------------------- 1 file changed, 114 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c5d3aaf..f75af81 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -54,118 +54,4 @@ new $package['extra']['laminas']['config-provider']() - - - testFactoryWithAssertion - testFactoryWithEmptyRolesPermissionsWithAssertion - testFactoryWithEmptyRolesPermissionsWithoutAssertion - testFactoryWithInvalidRole - testFactoryWithUnknownRole - testFactoryWithoutAssertion - testFactoryWithoutConfig - testFactoryWithoutLaminasRbacConfig - testFactoryWithoutPermissions - - - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - $this->container->reveal() - - - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - - - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - willReturn - - - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - - - - - testConstructorWithAssertion - testConstructorWithoutAssertion - testIsGrantedWitAssertion - testIsGrantedWithFailedRouting - testIsGrantedWithoutAssertion - testIsGrantedWithoutRouteResult - testIsNotGrantedWitAssertion - testIsNotGrantedWithoutAssertion - - - $this->assertion->reveal() - $this->assertion->reveal() - $this->assertion->reveal() - $this->assertion->reveal() - $this->assertion->reveal() - $this->assertion->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - $this->rbac->reveal() - - - willReturn - willReturn - willReturn - willReturn - - - shouldBeCalled - shouldBeCalled - - - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - reveal - - From 3b9701a3b91bc1ddd03294e6e056354cb468d029 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 16 Jan 2023 12:25:22 +0000 Subject: [PATCH 7/7] Add type coverage badge Signed-off-by: George Steel --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b2fab29..66820b8 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@ # mezzio-authorization-rbac [![Build Status](https://github.com/mezzio/mezzio-authorization-rbac/workflows/Continuous%20Integration/badge.svg)](https://github.com/mezzio/mezzio-authorization-rbac/actions?query=workflow%3A"Continuous+Integration") +[![Type Coverage](https://shepherd.dev/github/mezzio/mezzio-authorization-rbac/coverage.svg)](https://shepherd.dev/github/mezzio/mezzio-authorization-rbac) > ## πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ -> +> > ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. -> +> > Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. -> +> > Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ "НСт Π²ΠΎΠΉΠ½Π΅!" -> +> > ## πŸ‡ΊπŸ‡Έ To Citizens of Russia -> +> > We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. -> +> > One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. -> +> > You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!" [![Coverage Status](https://coveralls.io/repos/github/mezzio/mezzio-authorization-rbac/badge.svg?branch=master)](https://coveralls.io/github/mezzio/mezzio-authorization-rbac?branch=master)