diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c893558e..c7cb0afe 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,18 +1,18 @@ - + - ! is_array($page) && ! $page instanceof Traversable - ! is_array($pages) && ! $pages instanceof Traversable + + TPage|null - $this->pages + pages]]> - $this->findAllBy($property, $value) + findAllBy($property, $value)]]> TPage|null @@ -50,7 +50,7 @@ - $pages && (! is_array($pages) && ! $pages instanceof Traversable) + @@ -60,15 +60,12 @@ is_array($options) is_array($relations) is_array($relations) - is_string($order) - is_string($visible) - null !== $class && ! is_string($class) - 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 @@ -77,7 +74,7 @@ string - array{ + , * ... - * } + * }]]> addFactory - - $visible - $key @@ -128,29 +122,25 @@ $page - $this->rel[$relation] ?? null - $this->rel[$relation] ?? null - $this->rev[$relation] ?? - null - $this->rev[$relation] ?? - null + rel[$relation] ?? null]]> + rel[$relation] ?? null]]> + rev[$relation] ?? + null]]> + rev[$relation] ?? + null]]> - $this->label - $this->label - $this->rel[$relation] ?? null - $this->rev[$relation] ?? - null + label]]> + label]]> + rel[$relation] ?? null]]> + rev[$relation] ?? + null]]> $textDomain - - (string) $id - (bool) $active - (bool) $visible is_string($relation) @@ -158,19 +148,16 @@ null !== $fragment null !== $label - - __toString - ! is_string($route) - null !== $action && ! is_string($action) - null !== $controller && ! is_string($controller) + + null === $router - array{ + , * action: string|null, * controller: string|null, * params: array, @@ -193,7 +180,7 @@ * router: RouteStackInterface|MvcRouter\RouteStackInterface|null, * route_match: RouteMatch, * ... - * } + * }]]> Mvc @@ -237,7 +224,7 @@ RouteMatch|MvcRouter\RouteMatch RouteStackInterface|MvcRouter\RouteStackInterface - array{ + , * action: string|null, * controller: string|null, * params: array, @@ -260,13 +247,13 @@ * router: RouteStackInterface|MvcRouter\RouteStackInterface|null, * route_match: RouteMatch, * ... - * } + * }]]> null|RouteStackInterface|MvcRouter\RouteStackInterface - null !== $uri && ! is_string($uri) + $request @@ -275,13 +262,13 @@ string - $this->request + request]]> Request - array{ + , * uri: string|null, * ... - * } + * }]]> - $this->uri + uri]]> $request @@ -320,28 +307,28 @@ AbstractNavigationFactory - null === $this->pages + pages]]> $pages $pages - $configuration['navigation'][$this->getName()] - $page['pages'] + getName()]]]> + $routeMatch $router - $configuration['navigation'] - $configuration['navigation'][$this->getName()] - $page['pages'] + + getName()]]]> + - $page['pages'] - $page['request'] - $page['routeMatch'] - $page['router'] + + + + $application @@ -374,13 +361,13 @@ ConstructedNavigationFactory - null === $this->pages + pages]]> array|null|Config - $this->getPagesFromConfig($this->config) + getPagesFromConfig($this->config)]]> ConstructedNavigationFactory @@ -406,7 +393,7 @@ $requestedName - $this->config + config]]> array @@ -415,29 +402,34 @@ $config[$withoutPrefix] $config[strtolower($withoutPrefix)] - $this->config - $this->config + config]]> + config]]> $container $container - $this->config !== null + config !== null]]> - $config['navigation_helpers'] + - - $this->config - + + Config + new Config($config) + parent::configureServiceManager($serviceManager) + + + HelperConfig + getServiceLocator - $container->getServiceLocator() ?: $container + getServiceLocator() ?: $container]]> $container @@ -447,22 +439,22 @@ $class $pluginManager $services - $services->get('config') - $this->config[$type] + get('config')]]> + config[$type]]]> - $config['aliases'][$name] - $config['factories'][$class] - $config['factories'][$this->normalizeNameForV2($class)] - $this->config['delegators']['laminasviewhelpernavigation'] - $this->config['delegators'][NavigationHelper::class] + + + normalizeNameForV2($class)]]]> + config['delegators']['laminasviewhelpernavigation']]]> + config['delegators'][NavigationHelper::class]]]> - $config['factories'][$class] + $class - $config['aliases'][$name] + $pluginManager $services @@ -472,27 +464,17 @@ getPluginManager + + config]]> + config]]> + - $r->getValue($container) ?: $container - $r->getValue($container) ?: $container + getValue($container) ?: $container]]> + getValue($container) ?: $container]]> - - $this->config - $this->config - - $container->getServiceLocator() + getServiceLocator()]]> - - $container - $name - - - HelperConfig - - - HelperConfig - @@ -502,8 +484,8 @@ ContainerInterface - $r->getValue($container) ?: $container - $r->getValue($container) ?: $container + getValue($container) ?: $container]]> + getValue($container) ?: $container]]> $container @@ -539,20 +521,20 @@ $pages = new stdClass() - 'ok' - 'this is a string' + + 1337 new stdClass() - try { + 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()); - } + $this->assertStringContainsString('Invalid argument: $pages', $e->getMessage()); + }]]> _getFindByNavigation @@ -564,7 +546,7 @@ $found $found $found - $this->_getFindByNavigation() + _getFindByNavigation()]]> $actual[] @@ -633,8 +615,8 @@ toArray - $container->findOneBy('route', 'bar') - $container->findOneBy('route', 'baz') + findOneBy('route', 'bar')]]> + findOneBy('route', 'baz')]]> getLabel @@ -642,17 +624,17 @@ hasChildren - new AbstractContainer([ + 'Page 2', + 'type' => 'uri', ], [ - 'label' => 'Page 1', - 'type' => 'uri', - 'order' => -1, + 'label' => 'Page 1', + 'type' => 'uri', + 'order' => -1, ], - ]) + ])]]> $found @@ -681,14 +663,14 @@ TreeRouteStack::class - $this->routeMatch - $this->routeMatch - $this->routeMatch - $this->router - $this->router - $this->router - $this->router - $this->router + routeMatch]]> + routeMatch]]> + routeMatch]]> + router]]> + router]]> + router]]> + router]]> + router]]> addRoute @@ -708,35 +690,35 @@ $invalid - $event->getRouteMatch() - $event->getRouteMatch() - $event->getRouteMatch() - $event->getRouteMatch() - $event->getRouteMatch() + getRouteMatch()]]> + getRouteMatch()]]> + getRouteMatch()]]> + getRouteMatch()]]> + getRouteMatch()]]> - $this->route - $this->routeMatch - $this->router + route]]> + routeMatch]]> + router]]> - $this->routeMatch - $this->routeMatch - $this->routeMatch - $this->routeMatch - $this->router - $this->router - $this->router - $this->router - $this->router - $this->router - $this->router - $this->router + routeMatch]]> + routeMatch]]> + routeMatch]]> + routeMatch]]> + router]]> + router]]> + router]]> + router]]> + router]]> + router]]> + router]]> + router]]> - '' + $page @@ -750,10 +732,10 @@ - 'stdClass' + - 'label' => 'foo.bar' + 'foo.bar']]> $invalid @@ -763,13 +745,10 @@ $invalid $invalid $invalid - '-25' - '1' - 'False' - 'alternate' - 'alternate' - 'true' - 'true' + + + + 0 0 0 @@ -786,7 +765,7 @@ [] - $page->getPermission() + getPermission()]]> $childPage @@ -799,17 +778,17 @@ isVisible - $page->getPermission()->name + getPermission()->name]]> $invalid $invalid - $page->getPermission() + getPermission()]]> - $page->getPermission()->name + getPermission()->name]]> @@ -820,14 +799,14 @@ testCanCreateNavigationInstanceV2 - $this->factory - $this->factory + factory]]> + factory]]> - $this->factory + factory]]> - $this->factory + factory]]> @@ -843,7 +822,7 @@ setMethods - $factory($services, 'Navigation') + $pages @@ -852,8 +831,8 @@ $that - function ($that, $pages) use (&$recursive) { - function ($that, $pages) use (&$recursive) { + + $container @@ -865,10 +844,6 @@ $page $page - - $recursive($that, $page->getPages()) - $recursive($that, $page->getPages()) - assertInstanceOf assertInstanceOf @@ -884,9 +859,9 @@ getPages - $this->mvcEvent - $this->request - $this->router + mvcEvent]]> + request]]> + router]]> @@ -905,12 +880,6 @@ - - $this->logger - - - getLabel - getLabel diff --git a/src/Page/AbstractPage.php b/src/Page/AbstractPage.php index ac167373..d34c9e90 100644 --- a/src/Page/AbstractPage.php +++ b/src/Page/AbstractPage.php @@ -393,7 +393,7 @@ public function getFragment() /** * Sets page id * - * @param string|null $id [optional] id to set. Default is null, + * @param string|int|null $id [optional] id to set. Default is null, * which sets no id. * @return $this * @throws Exception\InvalidArgumentException If not given string or null. @@ -641,7 +641,7 @@ public function getRev($relation = null) /** * Sets page order to use in parent container * - * @param int|null $order page order in container. + * @param int|numeric-string|null $order page order in container. * Default is null, which sets no * specific order. * @return $this @@ -845,7 +845,7 @@ public function getActive($recursive = false) /** * Sets whether the page should be visible or not * - * @param bool $visible [optional] whether page should be + * @param bool|'true'|'false'|'TRUE'|'FALSE' $visible [optional] whether page should be * considered visible or not. Default is true. * @return $this */