diff --git a/composer.json b/composer.json index 41e2e9fc5..cfd0fb51e 100644 --- a/composer.json +++ b/composer.json @@ -46,15 +46,15 @@ "laminas/laminas-modulemanager": "^2.15", "laminas/laminas-mvc": "^3.7.0", "laminas/laminas-mvc-i18n": "^1.8", - "laminas/laminas-mvc-plugin-flashmessenger": "^1.10", - "laminas/laminas-navigation": "^2.19.0", - "laminas/laminas-paginator": "^2.18", + "laminas/laminas-mvc-plugin-flashmessenger": "^1.10.1", + "laminas/laminas-navigation": "^2.19.1", + "laminas/laminas-paginator": "^2.18.1", "laminas/laminas-permissions-acl": "^2.16", "laminas/laminas-router": "^3.12.0", "laminas/laminas-uri": "^2.11", - "phpunit/phpunit": "^10.5.5", + "phpunit/phpunit": "^10.5.9", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.18" + "vimeo/psalm": "^5.20" }, "conflict": { "container-interop/container-interop": "<1.2", diff --git a/composer.lock b/composer.lock index a68b7c52a..e66b091ac 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": "2d2ce4dd1a4c98f31574846b74249f6f", + "content-hash": "592dafb0d2f33db8a69049bf7183ec67", "packages": [ { "name": "laminas/laminas-escaper", @@ -289,16 +289,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.18.0", + "version": "3.19.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf" + "reference": "6a192dd0882b514e45506f533b833b623b78fff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", - "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/6a192dd0882b514e45506f533b833b623b78fff3", + "reference": "6a192dd0882b514e45506f533b833b623b78fff3", "shasum": "" }, "require": { @@ -309,10 +309,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.5", - "phpbench/phpbench": "^1.2.14", - "phpunit/phpunit": "^10.3.3", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^10.5.8", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.20.0" }, "type": "library", "autoload": { @@ -344,7 +344,7 @@ "type": "community_bridge" } ], - "time": "2023-09-19T10:15:21+00:00" + "time": "2024-01-19T12:39:49+00:00" }, { "name": "psr/container", @@ -1974,16 +1974,16 @@ }, { "name": "laminas/laminas-mvc-plugin-flashmessenger", - "version": "1.10.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-mvc-plugin-flashmessenger.git", - "reference": "e3e763d2a584b6fa5b1d09ec73e2f56fe45675b7" + "reference": "852d8c661dfb6492d4ea6d4ab238e72180e82387" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mvc-plugin-flashmessenger/zipball/e3e763d2a584b6fa5b1d09ec73e2f56fe45675b7", - "reference": "e3e763d2a584b6fa5b1d09ec73e2f56fe45675b7", + "url": "https://api.github.com/repos/laminas/laminas-mvc-plugin-flashmessenger/zipball/852d8c661dfb6492d4ea6d4ab238e72180e82387", + "reference": "852d8c661dfb6492d4ea6d4ab238e72180e82387", "shasum": "" }, "require": { @@ -2039,7 +2039,7 @@ "type": "community_bridge" } ], - "time": "2023-11-14T09:56:52+00:00" + "time": "2024-01-18T15:07:28+00:00" }, { "name": "laminas/laminas-navigation", @@ -2477,16 +2477,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.46.0", + "version": "2.47.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329" + "reference": "5c3fc8c4f1263cda5c5f14aed874fdadd5b90bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/98330256f8d8a1357a93f6f7f1a987036aff6329", - "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/5c3fc8c4f1263cda5c5f14aed874fdadd5b90bbd", + "reference": "5c3fc8c4f1263cda5c5f14aed874fdadd5b90bbd", "shasum": "" }, "require": { @@ -2557,7 +2557,7 @@ "type": "community_bridge" } ], - "time": "2024-01-03T12:43:04+00:00" + "time": "2024-01-17T11:31:50+00:00" }, { "name": "myclabs/deep-copy", @@ -3368,16 +3368,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.7", + "version": "10.5.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8" + "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e5c5b397a95cb0db013270a985726fcae93e61b8", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", + "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", "shasum": "" }, "require": { @@ -3449,7 +3449,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.7" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.9" }, "funding": [ { @@ -3465,7 +3465,7 @@ "type": "tidelift" } ], - "time": "2024-01-14T16:40:30+00:00" + "time": "2024-01-22T14:35:40+00:00" }, { "name": "psalm/plugin-phpunit", @@ -5523,16 +5523,16 @@ }, { "name": "vimeo/psalm", - "version": "5.19.0", + "version": "5.20.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b" + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/06b71be009a6bd6d81b9811855d6629b9fe90e1b", - "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", "shasum": "" }, "require": { @@ -5629,7 +5629,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2024-01-09T21:02:43+00:00" + "time": "2024-01-18T12:15:06+00:00" }, { "name": "webimpress/coding-standard", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 012919109..12f91ef14 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $closingBracket @@ -36,6 +36,11 @@ plugin + + + setResourceMap + + Cycle @@ -64,6 +69,9 @@ data[$this->name]]]> pointers[$this->name]]]> + + getName + @@ -183,6 +191,9 @@ options['rating']]]> options['secure']]]> + + ]]> + (bool) $flag (int) $imgSize @@ -206,7 +217,6 @@ $attributes[$itemKey] $href $index - $item autoEscape ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey]]]> autoEscape ? $this->escapeAttribute($value) : $value]]> $value @@ -236,6 +246,16 @@ $index view]]> + + createDataAlternate + createDataNext + createDataPrev + createDataStylesheet + + + AbstractContainer + AbstractContainer + (string) $conditionalStylesheet @@ -300,6 +320,10 @@ plugin plugin + + AbstractContainer + AbstractContainer + plugin plugin @@ -338,6 +362,10 @@ parent::__call($method, $args) parent::__call($method, $args) + + AbstractContainer + AbstractContainer + (bool) $flag @@ -372,10 +400,22 @@ $content $index + + AbstractContainer + AbstractContainer + is_string($content) + + $indent + + + + + HelperInterface + @@ -404,6 +444,9 @@ $options + + $content + @@ -462,6 +505,12 @@ (bool) $useNamespaces + + + getAuthenticationService + setAuthenticationService + + $response @@ -477,6 +526,9 @@ plugin + + __construct + (string) $template @@ -672,6 +724,13 @@ plugin + + + HelperInterface + HelperInterface + HelperInterface + + $relFlag @@ -719,6 +778,16 @@ null + + searchRelChapter + searchRelNext + searchRelPrev + searchRelSection + searchRelStart + searchRelSubsection + searchRevSection + searchRevSubsection + (int) $renderFlag @@ -748,6 +817,9 @@ + + bool + @@ -842,6 +914,10 @@ plugin plugin + + escapeLabels + setAddClassToListItem + (bool) $flag (bool) $flag @@ -1025,6 +1101,9 @@ parent::__invoke($name, $item) + + self + (string) $key @@ -1108,6 +1187,10 @@ $return + + __get + __set + (bool) $autoEscape (string) $string @@ -1136,6 +1219,10 @@ AbstractContainer + + getRegistry + unsetRegistry + (string) $key (string) $key @@ -1307,6 +1394,11 @@ $reuseMatchedParams + + + hasRoot + + null|ConfigInterface|ContainerInterface @@ -1319,7 +1411,6 @@ get('EventManager')]]> get('MvcTranslator')]]> get('Translator')]]> - get(TranslatorInterface::class)]]> $container @@ -1328,19 +1419,15 @@ ($name is class-string ? T : HelperInterface|callable) - - get - get - get - get - has - has - has - has - parent::get($name, $options) + + injectEventManager + injectRenderer + injectTranslator + validatePlugin + initializers]]> initializers]]> @@ -1379,6 +1466,11 @@ $captureTo + + getErrorLevel + getResult + setResult + @@ -1407,6 +1499,18 @@ $captureTo + + + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + + gettype($variables) @@ -1454,6 +1558,13 @@ $values + + __construct + setFilterChain + + + $config + @@ -1471,6 +1582,9 @@ $values + + $resolver + is_string($nameOrModel) @@ -1497,6 +1611,9 @@ $children $values + + $resolver + (bool) $mergeUnnamedChildren (string) $callback @@ -1556,7 +1673,6 @@ $variables - __file]]> $values @@ -1569,6 +1685,9 @@ __vars]]> resolve + + $config + (bool) $renderTrees @@ -1643,6 +1762,9 @@ + + TemplatePathStack + (bool) $flag (bool) $flag @@ -1696,6 +1818,9 @@ plugin + + $e + plugin @@ -1722,6 +1847,20 @@ $offset $offset + + stream_eof + stream_open + stream_read + stream_seek + stream_stat + stream_tell + url_stat + + + $mode + $opened_path + $options + break; break; @@ -2034,6 +2173,11 @@ HtmlFlash + + + $key + + $escape($value) @@ -2540,11 +2684,6 @@ vars()->message]]> - - - data]]> - - 1337 diff --git a/psalm.xml.dist b/psalm.xml.dist index 37fad743c..f21b0a73b 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -5,6 +5,9 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" + findUnusedBaselineEntry="true" + findUnusedPsalmSuppress="true" + findUnusedCode="true" > @@ -17,15 +20,6 @@ - - - - - - - - - @@ -41,6 +35,26 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php index c805cfa5d..a7e3bf049 100644 --- a/src/Helper/Doctype.php +++ b/src/Helper/Doctype.php @@ -94,7 +94,7 @@ public function __invoke($doctype = null) if (0 !== strpos($doctype, 'isHtml5() || stristr($this->getDoctype(), 'rdfa'); + return $this->isHtml5() || stristr($this->getDoctype(), 'rdfa') !== false; } } diff --git a/src/Helper/Gravatar.php b/src/Helper/Gravatar.php index f06dedfce..07ab90892 100644 --- a/src/Helper/Gravatar.php +++ b/src/Helper/Gravatar.php @@ -6,6 +6,7 @@ use Laminas\View\Exception; +use function is_string; use function md5; use function method_exists; use function preg_match; @@ -104,7 +105,7 @@ class Gravatar extends AbstractHtmlElement */ public function __invoke($email = "", $options = [], $attributes = []) { - if (! empty($email)) { + if (is_string($email) && $email !== '') { $this->setEmail($email); } if (! empty($options)) { diff --git a/src/Helper/HeadLink.php b/src/Helper/HeadLink.php index bdbea923c..f89cc0aa6 100644 --- a/src/Helper/HeadLink.php +++ b/src/Helper/HeadLink.php @@ -182,7 +182,7 @@ public function __call($method, $args) $item = $this->$dataMethod($args); } - if ($item) { + if (is_object($item)) { if ('offsetSet' === $action) { $this->offsetSet($index, $item); } else { diff --git a/src/Helper/HeadScript.php b/src/Helper/HeadScript.php index bae22fe27..6add0494a 100644 --- a/src/Helper/HeadScript.php +++ b/src/Helper/HeadScript.php @@ -463,7 +463,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd) $type = $this->autoEscape ? $this->escapeAttribute($item->type) : $item->type; $html = '