Skip to content

Commit

Permalink
Adjust annotations for improved upstream types
Browse files Browse the repository at this point in the history
- Bumps dev deps, refresh lock
- refresh psalm baseline

Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Jan 15, 2023
1 parent 76b11f5 commit 40ebfbe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 33 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 13 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 2 additions & 15 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.29.0@7ec5ffbd5f68ae03782d7fd33fff0c45a69f95b3">
<files psalm-version="5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863">
<file src="src/Extension/EscaperExtensionFactory.php">
<MixedArgument occurrences="1">
<code>$config['encoding'] ?? null</code>
Expand All @@ -17,9 +17,6 @@
<MixedArgument occurrences="2"/>
</file>
<file src="src/PlatesEngineFactory.php">
<DocblockTypeContradiction occurrences="1">
<code>is_string($extension)</code>
</DocblockTypeContradiction>
<InvalidStringClass occurrences="1">
<code>new $extension()</code>
</InvalidStringClass>
Expand Down Expand Up @@ -51,16 +48,6 @@
<MixedReturnStatement occurrences="1">
<code>$r-&gt;getValue($folders)</code>
</MixedReturnStatement>
<RedundantCondition occurrences="2">
<code>gettype($param)</code>
<code>gettype($templateName)</code>
</RedundantCondition>
<TypeDoesNotContainType occurrences="4">
<code>! is_string($param)</code>
<code>! is_string($templateName)</code>
<code>is_object($param)</code>
<code>is_object($templateName)</code>
</TypeDoesNotContainType>
</file>
<file src="test/ConfigProviderTest.php">
<RedundantCondition occurrences="1">
Expand Down Expand Up @@ -174,7 +161,7 @@
<code>getRouteResult</code>
<code>getRouteResult</code>
</DeprecatedMethod>
<MixedInferredReturnType occurrences="2">
<MixedInferredReturnType occurrences="1">
<code>array</code>
<code>array</code>
</MixedInferredReturnType>
Expand Down
6 changes: 5 additions & 1 deletion src/Extension/UrlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<string, mixed> $routeParams
* @param array<string, mixed> $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
Expand Down
5 changes: 3 additions & 2 deletions test/Extension/UrlExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testRegistersUrlFunctionWithEngine(): void
$this->extension->register($engine->reveal());
}

/** @return array<string, array{0: null|non-empty-string, 1: array<string, mixed>}> */
public function urlHelperParams(): array
{
return [
Expand All @@ -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<string, mixed> $params
*/
public function testGenerateUrlProxiesToUrlHelper($route, array $params): void
{
Expand Down

0 comments on commit 40ebfbe

Please sign in to comment.