From 636d24de18e2f1942b56ac5c5cf4e8029c145259 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 01:35:06 +0000 Subject: [PATCH 1/3] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/composer.lock b/composer.lock index e9bc37d..d4c2db0 100644 --- a/composer.lock +++ b/composer.lock @@ -64,16 +64,16 @@ }, { "name": "laminas/laminas-permissions-acl", - "version": "2.12.0", + "version": "2.13.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-permissions-acl.git", - "reference": "0d88f430953fbcbce382f09090db28905b90d60f" + "reference": "a13454dc3013cdcb388c95c418866e93dc781300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/0d88f430953fbcbce382f09090db28905b90d60f", - "reference": "0d88f430953fbcbce382f09090db28905b90d60f", + "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/a13454dc3013cdcb388c95c418866e93dc781300", + "reference": "a13454dc3013cdcb388c95c418866e93dc781300", "shasum": "" }, "require": { @@ -86,9 +86,9 @@ "require-dev": { "laminas/laminas-coding-standard": "~2.4.0", "laminas/laminas-servicemanager": "^3.19", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.29" + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0" }, "suggest": { "laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" @@ -123,7 +123,7 @@ "type": "community_bridge" } ], - "time": "2022-10-17T04:26:35+00:00" + "time": "2022-12-01T10:29:36+00:00" }, { "name": "mezzio/mezzio-authentication", @@ -1490,16 +1490,16 @@ }, { "name": "laminas/laminas-servicemanager", - "version": "3.19.0", + "version": "3.20.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "ed160729bb8721127efdaac799f9a298963345b1" + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/ed160729bb8721127efdaac799f9a298963345b1", - "reference": "ed160729bb8721127efdaac799f9a298963345b1", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", "shasum": "" }, "require": { @@ -1522,14 +1522,14 @@ "require-dev": { "composer/package-versions-deprecated": "^1.11.99.5", "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-container-config-test": "^0.7", + "laminas/laminas-container-config-test": "^0.8", "laminas/laminas-dependency-plugin": "^2.2", "mikey179/vfsstream": "^1.6.11@alpha", "ocramius/proxy-manager": "^2.14.1", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.28" + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "suggest": { "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" @@ -1576,20 +1576,20 @@ "type": "community_bridge" } ], - "time": "2022-10-10T20:59:22+00:00" + "time": "2022-12-01T17:03:38+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.15.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27" + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/63b66bd4b696f024f42616b9d95cdb10e5109c27", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", "shasum": "" }, "require": { @@ -1600,10 +1600,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.4.0", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.28" + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "type": "library", "autoload": { @@ -1635,7 +1635,7 @@ "type": "community_bridge" } ], - "time": "2022-10-10T19:10:24+00:00" + "time": "2022-11-30T23:45:45+00:00" }, { "name": "myclabs/deep-copy", From cde1e4c092ad300b9e1e8b8dc6ae5651fd05f2fb Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 5 Dec 2022 15:17:22 +0000 Subject: [PATCH 2/3] Fix newly surfaced psalm issues Signed-off-by: George Steel --- psalm-baseline.xml | 13 ++----------- src/LaminasAclFactory.php | 8 ++++---- test/ConfigProviderTest.php | 12 ++++++++++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 4ae1b06..55d2d50 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,12 +1,11 @@ - + $routeName - $config['allow'] ?? [] $config['deny'] ?? [] @@ -27,23 +26,15 @@ $configProvider() - + $configProvider() - $config['dependencies'] - - $dependencies - $json['packages'] $package['extra'] $package['extra']['laminas'] $package['extra']['laminas']['config-provider'] - - $config['dependencies']['services'] - $config['dependencies']['services']['config'] - $json $package diff --git a/src/LaminasAclFactory.php b/src/LaminasAclFactory.php index 02e5153..5f13a5e 100644 --- a/src/LaminasAclFactory.php +++ b/src/LaminasAclFactory.php @@ -61,14 +61,14 @@ private function injectRoles(Acl $acl, array $roles): void try { $acl->addRole($parent); } catch (AclExceptionInterface $e) { - throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e); + throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e); } } } try { $acl->addRole($role, $parents); } catch (AclExceptionInterface $e) { - throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e); + throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e); } } } @@ -83,7 +83,7 @@ private function injectResources(Acl $acl, array $resources): void try { $acl->addResource($resource); } catch (AclExceptionInterface $e) { - throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e); + throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e); } } } @@ -107,7 +107,7 @@ private function injectPermissions(Acl $acl, array $permissions, string $type): ? $acl->allow($role, $resources) : $acl->deny($role, $resources); } catch (AclExceptionInterface $e) { - throw new Exception\InvalidConfigException($e->getMessage(), (int) $e->getCode(), $e); + throw new Exception\InvalidConfigException($e->getMessage(), $e->getCode(), $e); } } } diff --git a/test/ConfigProviderTest.php b/test/ConfigProviderTest.php index eb5e6b7..405b292 100644 --- a/test/ConfigProviderTest.php +++ b/test/ConfigProviderTest.php @@ -4,6 +4,7 @@ namespace MezzioTest\Authorization\Acl; +use Laminas\ServiceManager\ConfigInterface; use Laminas\ServiceManager\ServiceManager; use Mezzio\Authorization\Acl\ConfigProvider; use Mezzio\Authorization\Acl\LaminasAcl; @@ -15,6 +16,7 @@ use function json_decode; use function sprintf; +/** @psalm-import-type ServiceManagerConfigurationType from ConfigInterface */ class ConfigProviderTest extends TestCase { private ConfigProvider $provider; @@ -64,10 +66,15 @@ public function testServicesDefinedInConfigProvider(): void } } - $config['dependencies']['services']['config'] = [ + self::assertIsArray($config['dependencies']); + /** @psalm-var ServiceManagerConfigurationType $dependencies */ + $dependencies = $config['dependencies']; + unset($dependencies['services']['config']); + $dependencies['services']['config'] = [ 'mezzio-authorization-acl' => ['roles' => [], 'resources' => []], ]; - $container = $this->getContainer($config['dependencies']); + + $container = $this->getContainer($dependencies); $dependencies = $this->provider->getDependencies(); foreach ($dependencies['factories'] as $name => $factory) { @@ -81,6 +88,7 @@ public function testServicesDefinedInConfigProvider(): void } } + /** @param ServiceManagerConfigurationType $dependencies */ private function getContainer(array $dependencies): ServiceManager { return new ServiceManager($dependencies); From 6b9e18c60625f8aa1626fb2ab626db8ae8bf6753 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 5 Dec 2022 15:17:35 +0000 Subject: [PATCH 3/3] Update lock and bump dev deps Signed-off-by: George Steel --- composer.json | 6 +++--- composer.lock | 38 +++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index d57f835..5c05481 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-servicemanager": "^3.19.0", + "laminas/laminas-servicemanager": "^3.20", "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0" + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.1" }, "conflict": { "container-interop/container-interop": "<1.2.0", diff --git a/composer.lock b/composer.lock index d4c2db0..c8948e2 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": "5a1a4e765717b861c302feb6973e3839", + "content-hash": "ddc37dfefb0ede557c3a8e51f7c37376", "packages": [ { "name": "fig/http-message-util", @@ -1580,16 +1580,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.16.0", + "version": "3.16.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c" + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", - "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/f4f773641807c7ccee59b758bfe4ac4ba33ecb17", + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17", "shasum": "" }, "require": { @@ -1635,7 +1635,7 @@ "type": "community_bridge" } ], - "time": "2022-11-30T23:45:45+00:00" + "time": "2022-12-03T18:48:01+00:00" }, { "name": "myclabs/deep-copy", @@ -2598,16 +2598,16 @@ }, { "name": "psalm/plugin-phpunit", - "version": "0.18.3", + "version": "0.18.4", "source": { "type": "git", "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "057c1cdf7546c1e427f6fd83b635d0cc18c252bf" + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/057c1cdf7546c1e427f6fd83b635d0cc18c252bf", - "reference": "057c1cdf7546c1e427f6fd83b635d0cc18c252bf", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", "shasum": "" }, "require": { @@ -2615,7 +2615,7 @@ "composer/semver": "^1.4 || ^2.0 || ^3.0", "ext-simplexml": "*", "php": "^7.1 || ^8.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.5 || ^5@beta" + "vimeo/psalm": "dev-master || dev-4.x || ^4.7.1 || ^5@beta || ^5.0" }, "conflict": { "phpunit/phpunit": "<7.5" @@ -2652,9 +2652,9 @@ "description": "Psalm plugin for PHPUnit", "support": { "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.3" + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.4" }, - "time": "2022-11-03T18:17:28+00:00" + "time": "2022-12-03T07:47:07+00:00" }, { "name": "psr/log", @@ -4645,16 +4645,16 @@ }, { "name": "vimeo/psalm", - "version": "5.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8" + "reference": "4defa177c89397c5e14737a80fe4896584130674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", - "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4defa177c89397c5e14737a80fe4896584130674", + "reference": "4defa177c89397c5e14737a80fe4896584130674", "shasum": "" }, "require": { @@ -4743,9 +4743,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.0.0" + "source": "https://github.com/vimeo/psalm/tree/5.1.0" }, - "time": "2022-11-30T06:06:01+00:00" + "time": "2022-12-02T01:23:35+00:00" }, { "name": "webimpress/coding-standard",