From d5097981ecb89a7710eff581bf487b3b982bac8d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Jan 2023 00:55:34 +0000 Subject: [PATCH 1/2] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 136 ++++++++++---------------------------------------- 1 file changed, 26 insertions(+), 110 deletions(-) diff --git a/composer.lock b/composer.lock index 989de105..1ff679b7 100644 --- a/composer.lock +++ b/composer.lock @@ -4325,16 +4325,16 @@ }, { "name": "symfony/console", - "version": "v6.0.17", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2ab307342a7233b9a260edd5ef94087aaca57d18" + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2ab307342a7233b9a260edd5ef94087aaca57d18", - "reference": "2ab307342a7233b9a260edd5ef94087aaca57d18", + "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed", + "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed", "shasum": "" }, "require": { @@ -4400,7 +4400,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.17" + "source": "https://github.com/symfony/console/tree/v6.0.19" }, "funding": [ { @@ -4416,7 +4416,7 @@ "type": "tidelift" } ], - "time": "2022-12-28T14:21:34+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4487,16 +4487,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.0.13", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3adca49133bd055ebe6011ed1e012be3c908af79" + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3adca49133bd055ebe6011ed1e012be3c908af79", - "reference": "3adca49133bd055ebe6011ed1e012be3c908af79", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", "shasum": "" }, "require": { @@ -4530,7 +4530,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.13" + "source": "https://github.com/symfony/filesystem/tree/v6.0.19" }, "funding": [ { @@ -4546,7 +4546,7 @@ "type": "tidelift" } ], - "time": "2022-09-21T20:25:27+00:00" + "time": "2023-01-20T17:44:14+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4878,89 +4878,6 @@ ], "time": "2022-11-03T14:55:06+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, { "name": "symfony/service-contracts", "version": "v2.5.2", @@ -5046,16 +4963,16 @@ }, { "name": "symfony/string", - "version": "v6.0.17", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "3f57003dd8a67ed76870cc03092f8501db7788d9" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/3f57003dd8a67ed76870cc03092f8501db7788d9", - "reference": "3f57003dd8a67ed76870cc03092f8501db7788d9", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { @@ -5111,7 +5028,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.17" + "source": "https://github.com/symfony/string/tree/v6.0.19" }, "funding": [ { @@ -5127,7 +5044,7 @@ "type": "tidelift" } ], - "time": "2022-12-14T15:52:41+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "theseer/tokenizer", @@ -5181,16 +5098,16 @@ }, { "name": "vimeo/psalm", - "version": "5.4.0", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863" + "reference": "e784128902dfe01d489c4123d69918a9f3c1eac5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", - "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/e784128902dfe01d489c4123d69918a9f3c1eac5", + "reference": "e784128902dfe01d489c4123d69918a9f3c1eac5", "shasum": "" }, "require": { @@ -5213,11 +5130,10 @@ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", - "sebastian/diff": "^4.0", + "sebastian/diff": "^4.0 || ^5.0", "spatie/array-to-xml": "^2.17.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/polyfill-php80": "^1.25" + "symfony/filesystem": "^5.4 || ^6.0" }, "provide": { "psalm/psalm": "self.version" @@ -5280,9 +5196,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.4.0" + "source": "https://github.com/vimeo/psalm/tree/5.6.0" }, - "time": "2022-12-19T21:31:12+00:00" + "time": "2023-01-23T20:32:47+00:00" }, { "name": "webimpress/coding-standard", From d87c891d6ed020586bdbea6df243041983483004 Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 26 Jan 2023 09:33:00 +0000 Subject: [PATCH 2/2] Expand baseline with newly discovered `DocBlockTypeContradiction` issues In both cases, the issues are due to defensive type checks that are required due to lack of parameter type hints. Signed-off-by: George Steel --- composer.json | 8 +- composer.lock | 14 +- psalm-baseline.xml | 453 ++++++++++++++++++++++++++++----------------- 3 files changed, 292 insertions(+), 183 deletions(-) diff --git a/composer.json b/composer.json index a7850b4b..c9a37812 100644 --- a/composer.json +++ b/composer.json @@ -41,13 +41,13 @@ "laminas/laminas-i18n": "^2.21", "laminas/laminas-mvc": "^3.6", "laminas/laminas-permissions-acl": "^2.13", - "laminas/laminas-router": "^3.11", + "laminas/laminas-router": "^3.11.1", "laminas/laminas-servicemanager": "^3.20", "laminas/laminas-uri": "^2.10.0", - "laminas/laminas-view": "^2.25", - "phpunit/phpunit": "^9.5.26", + "laminas/laminas-view": "^2.26", + "phpunit/phpunit": "^9.5.28", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.1" + "vimeo/psalm": "^5.6" }, "suggest": { "laminas/laminas-config": "^3.7, to provide page configuration (optional, as arrays and Traversables are also allowed)", diff --git a/composer.lock b/composer.lock index 1ff679b7..52b14b0c 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": "d87be750d55ee56cb9f9f9f8b3b4075c", + "content-hash": "adf0554bf8f3bf7304828a34c662efe9", "packages": [ { "name": "laminas/laminas-stdlib", @@ -2549,16 +2549,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.23", + "version": "9.2.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", "shasum": "" }, "require": { @@ -2614,7 +2614,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" }, "funding": [ { @@ -2622,7 +2622,7 @@ "type": "github" } ], - "time": "2022-12-28T12:41:10+00:00" + "time": "2023-01-26T08:26:55+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 234e935a..96474c86 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,60 +1,60 @@ - + - + ! is_array($page) && ! $page instanceof Traversable ! is_array($pages) && ! $pages instanceof Traversable - + TPage|null - + $this->pages - + $this->findAllBy($property, $value) - + TPage|null - + $page - + $page $page $propertyValue $propertyValue - + TPage|null - + get - + $page $page - + $page - + current - + \Zend\Navigation\Navigation - + $pages && (! is_array($pages) && ! $pages instanceof Traversable) - + - + ! is_string($property) ! is_string($property) is_array($options) @@ -66,26 +66,46 @@ null !== $fragment && ! is_string($fragment) null !== $id && ! is_string($id) null !== $label && ! is_string($label) + null !== $order && ! is_int($order) null !== $target && ! is_string($target) null !== $title && ! is_string($title) - + string - + string - - + + array{ + * label: string|null, + * fragment: string|null, + * id: string|null, + * class: string|null, + * title: string|null, + * target: string|null, + * rel: array|null, + * rev: array|null, + * order: int|null, + * resource: ResourceInterface|string|null, + * privilege: string|null, + * permission: mixed|null, + * active: bool, + * visible: bool, + * pages: list<array>, + * ... + * } + + addFactory - + $visible - + $key - + $factoryCallBack $name $name @@ -95,62 +115,90 @@ $type $value - + call_user_func($factoryCallBack, $options) - + AbstractPage array array - + new $type($options) - + $page $this->rel[$relation] ?? null $this->rel[$relation] ?? null + $this->rev[$relation] ?? + null + $this->rev[$relation] ?? + null - + $this->label $this->label $this->rel[$relation] ?? null + $this->rev[$relation] ?? + null - + $textDomain - + (string) $id - + (bool) $active (bool) $visible - + is_string($relation) is_string($relation) null !== $fragment null !== $label - - null !== $order && ! is_int($order) - - + ! is_string($route) null !== $action && ! is_string($action) null !== $controller && ! is_string($controller) null === $router - - + + array{ + * label: string|null, + * fragment: string|null, + * id: string|null, + * class: string|null, + * title: string|null, + * target: string|null, + * rel: array|null, + * rev: array|null, + * order: int|null, + * resource: ResourceInterface|string|null, + * privilege: string|null, + * permission: mixed|null, + * active: bool, + * visible: bool, + * pages: list<array>, + * action: string|null, + * controller: string|null, + * params: array, + * route: string, + * router: RouteStackInterface|MvcRouter\RouteStackInterface|null, + * route_match: RouteMatch, + * ... + * } + + Mvc Mvc bool string - + $action $controller $query @@ -162,7 +210,7 @@ null null - + $action $controller $hrefCache @@ -172,83 +220,127 @@ $router Mvc - + (bool) $useRouteMatch - + null !== $action null !== $route - + MvcRouter\RouteMatch MvcRouter\RouteStackInterface - + RouteMatch|MvcRouter\RouteMatch RouteStackInterface|MvcRouter\RouteStackInterface + array{ + * label: string|null, + * fragment: string|null, + * id: string|null, + * class: string|null, + * title: string|null, + * target: string|null, + * rel: array|null, + * rev: array|null, + * order: int|null, + * resource: ResourceInterface|string|null, + * privilege: string|null, + * permission: mixed|null, + * active: bool, + * visible: bool, + * pages: list<array>, + * action: string|null, + * controller: string|null, + * params: array, + * route: string, + * router: RouteStackInterface|MvcRouter\RouteStackInterface|null, + * route_match: RouteMatch, + * ... + * } null|RouteStackInterface|MvcRouter\RouteStackInterface - + null !== $uri && ! is_string($uri) - + $request - + string - + $this->request - + Request - - + + array{ + * label: string|null, + * fragment: string|null, + * id: string|null, + * class: string|null, + * title: string|null, + * target: string|null, + * rel: array|null, + * rev: array|null, + * order: int|null, + * resource: ResourceInterface|string|null, + * privilege: string|null, + * permission: mixed|null, + * active: bool, + * visible: bool, + * pages: list<array>, + * uri: string|null, + * ... + * } + + $this->uri - + $request - + $request Uri - + null !== $uri - + AbstractNavigationFactory - + null === $this->pages - + $pages $pages - + $configuration['navigation'][$this->getName()] $page['pages'] $routeMatch $router - + $configuration['navigation'] $configuration['navigation'][$this->getName()] $page['pages'] - + $page['pages'] $page['request'] $page['routeMatch'] $page['router'] - + $application $configuration $page @@ -256,7 +348,7 @@ $routeMatch $router - + getMvcEvent getMvcEvent getMvcEvent @@ -264,187 +356,196 @@ getRouteMatch getRouter - + $container - + $pages - + $pages - + ConstructedNavigationFactory - + null === $this->pages - + array|null|Config - + $this->getPagesFromConfig($this->config) - + ConstructedNavigationFactory - + DefaultNavigationFactory - + NavigationAbstractServiceFactory - + $config - + $requestedName - + $requestedName $requestedName - + $this->config - + array array - + $config[$withoutPrefix] $config[strtolower($withoutPrefix)] $this->config $this->config - + $container $container - + $this->config !== null - + $config['navigation_helpers'] - + getServiceLocator - + $container->getServiceLocator() ?: $container - + $container $name - + $class $pluginManager $services $services->get('config') $this->config[$type] - + $config['aliases'][$name] $config['factories'][$class] $config['factories'][$this->normalizeNameForV2($class)] $this->config['delegators']['laminasviewhelpernavigation'] $this->config['delegators'][NavigationHelper::class] - + $config['factories'][$class] - + $class $config['aliases'][$name] $pluginManager $services - + ServiceManager - + getPluginManager - + $r->getValue($container) ?: $container $r->getValue($container) ?: $container - + $this->config $this->config - + $container->getServiceLocator() - + $container $name - + NavigationHelperFactory - + ContainerInterface - + $r->getValue($container) ?: $container $r->getValue($container) ?: $container - + $container - + ViewHelperManagerDelegatorFactory - + $viewHelpers - + $callback $name $name $requestedName - + $callback $viewHelpers - + $viewHelpers - + HelperPluginManager - + $container - + $pages = new stdClass() 'ok' 'this is a string' 1337 new stdClass() - - + + try { + $nav = new Navigation\Navigation(new stdClass()); + $this->fail('An invalid argument was given to the constructor, ' + . 'but a Laminas\Navigation\Exception\InvalidArgumentException was ' + . 'not thrown'); + } catch (Navigation\Exception\ExceptionInterface $e) { + $this->assertStringContainsString('Invalid argument: $pages', $e->getMessage()); + } + + _getFindByNavigation - + $found $found $found @@ -453,7 +554,7 @@ $found $this->_getFindByNavigation() - + $actual[] $actual[] $actual[] @@ -491,7 +592,7 @@ $page $page - + addPage addPage addPage @@ -519,17 +620,29 @@ getPagez toArray - + $container->findOneBy('route', 'bar') $container->findOneBy('route', 'baz') - + getLabel hasChildren hasChildren - - + + new AbstractContainer([ + [ + 'label' => 'Page 2', + 'type' => 'uri', + ], + [ + 'label' => 'Page 1', + 'type' => 'uri', + 'order' => -1, + ], + ]) + + $found $found $nav @@ -539,12 +652,12 @@ - + null - + $newRouter $router $router @@ -555,7 +668,7 @@ $router TreeRouteStack::class - + $this->routeMatch $this->routeMatch $this->routeMatch @@ -565,36 +678,36 @@ $this->router $this->router - + addRoute addRoute setMatchedRouteName setMatchedRouteName - + null null null null null - + $invalid $invalid - + $event->getRouteMatch() $event->getRouteMatch() $event->getRouteMatch() $event->getRouteMatch() $event->getRouteMatch() - + $this->route $this->routeMatch $this->router - + $this->routeMatch $this->routeMatch $this->routeMatch @@ -610,27 +723,27 @@ - + '' - + $page - + $page - + $page - + 'stdClass' - + 'label' => 'foo.bar' - + $invalid $invalid $invalid @@ -656,81 +769,81 @@ [] new stdClass() - + [] [] - + $page->getPermission() - + $childPage $childPage - + getVisible getVisible isVisible isVisible - + $page->getPermission()->name - + $invalid $invalid - + $page->getPermission() - + $page->getPermission()->name - + new Router\Http\TreeRouteStack() - + testCanCreateNavigationInstanceV2 - + $this->factory $this->factory - + $this->factory - + $this->factory - + TestNavigationFactory - + TestNavigationFactory - + setMethods - + $factory($services, 'Navigation') - + $pages $pages $that $that - + function ($that, $pages) use (&$recursive) { function ($that, $pages) use (&$recursive) { - + $container $container $container @@ -740,11 +853,11 @@ $page $page - + $recursive($that, $page->getPages()) $recursive($that, $page->getPages()) - + assertInstanceOf assertInstanceOf assertInstanceOf @@ -758,68 +871,64 @@ getPages getPages - + $this->mvcEvent $this->request $this->router - + addPage - + FileNavigationFactory - + Page - + $this->logger - - beginIteration - endIteration - - + getLabel - + Router Router - + $services - + testConfigureServiceManagerWithConfig - + $helpers $services - + $helpers - + array - + findHelper - + function () use ($helpers) {