From 76b11f5898374f55571be27671777afc2904f50d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 01:03:19 +0000 Subject: [PATCH 1/2] 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 973c2a0..a15fc96 100644 --- a/composer.lock +++ b/composer.lock @@ -190,16 +190,16 @@ }, { "name": "mezzio/mezzio-helpers", - "version": "5.11.0", + "version": "5.12.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-helpers.git", - "reference": "ac47b19c92e050e53fe9172d3ccf7ab7cf9e9945" + "reference": "e165b3dac9c314ab7f879740ca12455b20716b1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-helpers/zipball/ac47b19c92e050e53fe9172d3ccf7ab7cf9e9945", - "reference": "ac47b19c92e050e53fe9172d3ccf7ab7cf9e9945", + "url": "https://api.github.com/repos/mezzio/mezzio-helpers/zipball/e165b3dac9c314ab7f879740ca12455b20716b1d", + "reference": "e165b3dac9c314ab7f879740ca12455b20716b1d", "shasum": "" }, "require": { @@ -214,11 +214,11 @@ }, "require-dev": { "ext-json": "*", - "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-diactoros": "^2.19", "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.29" + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0" }, "suggest": { "ext-json": "If you wish to use the JsonStrategy with BodyParamsMiddleware" @@ -262,20 +262,20 @@ "type": "community_bridge" } ], - "time": "2022-10-12T21:00:46+00:00" + "time": "2023-01-11T08:34:19+00:00" }, { "name": "mezzio/mezzio-router", - "version": "3.11.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-router.git", - "reference": "a80fb92d25deae21e76452f541129c09aa52a886" + "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/a80fb92d25deae21e76452f541129c09aa52a886", - "reference": "a80fb92d25deae21e76452f541129c09aa52a886", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/a30bb059261e6d1d980bcd35b4f8ed537cf8087f", + "reference": "a30bb059261e6d1d980bcd35b4f8ed537cf8087f", "shasum": "" }, "require": { @@ -293,11 +293,11 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-diactoros": "^2.20.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", @@ -343,7 +343,7 @@ "type": "community_bridge" } ], - "time": "2023-01-11T00:54:57+00:00" + "time": "2023-01-12T15:10:48+00:00" }, { "name": "mezzio/mezzio-template", From 40ebfbeb4555637e33852e882d69d50b5082c4d7 Mon Sep 17 00:00:00 2001 From: George Steel Date: Sun, 15 Jan 2023 11:11:53 +0000 Subject: [PATCH 2/2] Adjust annotations for improved upstream types - Bumps dev deps, refresh lock - refresh psalm baseline Signed-off-by: George Steel --- composer.json | 4 ++-- composer.lock | 26 +++++++++++++------------- psalm-baseline.xml | 17 ++--------------- src/Extension/UrlExtension.php | 6 +++++- test/Extension/UrlExtensionTest.php | 5 +++-- 5 files changed, 25 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index ed4e771..df3a857 100644 --- a/composer.json +++ b/composer.json @@ -46,9 +46,9 @@ "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", "phpspec/prophecy-phpunit": "^2.0.1", - "phpunit/phpunit": "^9.5.26", + "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "0.18.4", - "vimeo/psalm": "^5.0.0" + "vimeo/psalm": "^5.4" }, "conflict": { "container-interop/container-interop": "<1.2.0", diff --git a/composer.lock b/composer.lock index a15fc96..14f3f76 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": "369ff9f011a1ca5756b90a8dec901549", + "content-hash": "fbf1eb99ce1514d330011868ab6e35cc", "packages": [ { "name": "fig/http-message-util", @@ -266,16 +266,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": { @@ -343,7 +343,7 @@ "type": "community_bridge" } ], - "time": "2023-01-12T15:10:48+00:00" + "time": "2023-01-15T08:25:11+00:00" }, { "name": "mezzio/mezzio-template", @@ -2526,20 +2526,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": "*", @@ -2608,7 +2608,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": [ { @@ -2624,7 +2624,7 @@ "type": "tidelift" } ], - "time": "2022-12-09T07:31:23+00:00" + "time": "2023-01-14T12:32:24+00:00" }, { "name": "psalm/plugin-phpunit", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5794bdd..c2c6ba3 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $config['encoding'] ?? null @@ -17,9 +17,6 @@ - - is_string($extension) - new $extension() @@ -51,16 +48,6 @@ $r->getValue($folders) - - gettype($param) - gettype($templateName) - - - ! is_string($param) - ! is_string($templateName) - is_object($param) - is_object($templateName) - @@ -174,7 +161,7 @@ getRouteResult getRouteResult - + array array diff --git a/src/Extension/UrlExtension.php b/src/Extension/UrlExtension.php index 616cbb4..e90c00b 100644 --- a/src/Extension/UrlExtension.php +++ b/src/Extension/UrlExtension.php @@ -10,6 +10,7 @@ use Mezzio\Helper\UrlHelper; use Mezzio\Router\RouteResult; +/** @psalm-import-type UrlGeneratorOptions from UrlHelper */ class UrlExtension implements ExtensionInterface { public function __construct(private UrlHelper $urlHelper, private ServerUrlHelper $serverUrlHelper) @@ -50,7 +51,10 @@ public function getRouteResult(): ?RouteResult * used internally to back the url() Plates function; we now register * UrlHelper instance directly, as it is callable. * - * @param array $options Can have the following keys: + * @param non-empty-string|null $routeName + * @param array $routeParams + * @param array $queryParams + * @psalm-param UrlGeneratorOptions $options Can have the following keys: * - router (array): contains options to be passed to the router * - reuse_result_params (bool): indicates if the current RouteResult * parameters will be used, defaults to true diff --git a/test/Extension/UrlExtensionTest.php b/test/Extension/UrlExtensionTest.php index 61dc2e9..4617898 100644 --- a/test/Extension/UrlExtensionTest.php +++ b/test/Extension/UrlExtensionTest.php @@ -52,6 +52,7 @@ public function testRegistersUrlFunctionWithEngine(): void $this->extension->register($engine->reveal()); } + /** @return array}> */ public function urlHelperParams(): array { return [ @@ -64,8 +65,8 @@ public function urlHelperParams(): array /** * @dataProvider urlHelperParams - * @param null|string $route - * @param array $params + * @param null|non-empty-string $route + * @param array $params */ public function testGenerateUrlProxiesToUrlHelper($route, array $params): void {