diff --git a/composer.json b/composer.json index 32208e1a8..36816ec23 100644 --- a/composer.json +++ b/composer.json @@ -38,23 +38,23 @@ "psr/container": "^1 || ^2" }, "require-dev": { - "laminas/laminas-authentication": "^2.15", + "laminas/laminas-authentication": "^2.16", "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-feed": "^2.22", - "laminas/laminas-filter": "^2.32", + "laminas/laminas-filter": "^2.34", "laminas/laminas-http": "^2.19", - "laminas/laminas-i18n": "^2.23.1", + "laminas/laminas-i18n": "^2.26.0", "laminas/laminas-modulemanager": "^2.15", - "laminas/laminas-mvc": "^3.6.1", - "laminas/laminas-mvc-i18n": "^1.7", - "laminas/laminas-navigation": "^2.18.1", - "laminas/laminas-paginator": "^2.17", + "laminas/laminas-mvc": "^3.7.0", + "laminas/laminas-mvc-i18n": "^1.8", + "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.4.2", + "phpunit/phpunit": "^10.5.9", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.15" + "vimeo/psalm": "^5.20" }, "conflict": { "container-interop/container-interop": "<1.2", diff --git a/composer.lock b/composer.lock index 803a4e08c..f5db38f21 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": "b0c418f8e21dfd1b22c09c160f09f84d", + "content-hash": "dfd16c568b651d75cbf04e3bbdddcdd1", "packages": [ { "name": "laminas/laminas-escaper", @@ -70,16 +70,16 @@ }, { "name": "laminas/laminas-eventmanager", - "version": "3.12.0", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-eventmanager.git", - "reference": "4a576922c00cc7838d60d004a7bd6f5a02c23b57" + "reference": "ce5ba8bde378fca5cb0cd514f01823637215b2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/4a576922c00cc7838d60d004a7bd6f5a02c23b57", - "reference": "4a576922c00cc7838d60d004a7bd6f5a02c23b57", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/ce5ba8bde378fca5cb0cd514f01823637215b2f3", + "reference": "ce5ba8bde378fca5cb0cd514f01823637215b2f3", "shasum": "" }, "require": { @@ -91,12 +91,12 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-stdlib": "^3.17", - "phpbench/phpbench": "^1.2.10", - "phpunit/phpunit": "^10.4.1", + "laminas/laminas-stdlib": "^3.18", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^10.5.5", "psalm/plugin-phpunit": "^0.18.4", "psr/container": "^1.1.2 || ^2.0.2", - "vimeo/psalm": "^5.11" + "vimeo/psalm": "^5.18" }, "suggest": { "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature", @@ -134,7 +134,7 @@ "type": "community_bridge" } ], - "time": "2023-10-18T16:36:45+00:00" + "time": "2024-01-03T17:43:50+00:00" }, { "name": "laminas/laminas-json", @@ -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", @@ -1458,16 +1458,16 @@ }, { "name": "laminas/laminas-filter", - "version": "2.33.0", + "version": "2.34.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-filter.git", - "reference": "6ad64828d25ec4bdf226ec5096aabb04aa710324" + "reference": "008923542683d853109af5c71b7e9099de76c3e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/6ad64828d25ec4bdf226ec5096aabb04aa710324", - "reference": "6ad64828d25ec4bdf226ec5096aabb04aa710324", + "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/008923542683d853109af5c71b7e9099de76c3e6", + "reference": "008923542683d853109af5c71b7e9099de76c3e6", "shasum": "" }, "require": { @@ -1482,14 +1482,14 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-crypt": "^3.10", - "laminas/laminas-i18n": "^2.23.1", + "laminas/laminas-crypt": "^3.11", + "laminas/laminas-i18n": "^2.25.0", "laminas/laminas-uri": "^2.11", "pear/archive_tar": "^1.4.14", - "phpunit/phpunit": "^10.4.2", + "phpunit/phpunit": "^10.5.5", "psalm/plugin-phpunit": "^0.18.4", "psr/http-factory": "^1.0.2", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.18.0" }, "suggest": { "laminas/laminas-crypt": "Laminas\\Crypt component, for encryption filters", @@ -1533,7 +1533,7 @@ "type": "community_bridge" } ], - "time": "2023-11-03T13:29:10+00:00" + "time": "2024-01-04T11:47:08+00:00" }, { "name": "laminas/laminas-http", @@ -1602,16 +1602,16 @@ }, { "name": "laminas/laminas-i18n", - "version": "2.25.0", + "version": "2.26.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-i18n.git", - "reference": "4b6df8501bfe96648dadaf8de681cbbaea906e04" + "reference": "01738410cb263994d1d192861f642387e7e12ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/4b6df8501bfe96648dadaf8de681cbbaea906e04", - "reference": "4b6df8501bfe96648dadaf8de681cbbaea906e04", + "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/01738410cb263994d1d192861f642387e7e12ace", + "reference": "01738410cb263994d1d192861f642387e7e12ace", "shasum": "" }, "require": { @@ -1625,18 +1625,18 @@ "zendframework/zend-i18n": "*" }, "require-dev": { - "laminas/laminas-cache": "^3.11.0", + "laminas/laminas-cache": "^3.12.0", "laminas/laminas-cache-storage-adapter-memory": "^2.3.0", - "laminas/laminas-cache-storage-deprecated-factory": "^1.1", + "laminas/laminas-cache-storage-deprecated-factory": "^1.2", "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-config": "^3.9.0", - "laminas/laminas-eventmanager": "^3.12", - "laminas/laminas-filter": "^2.33", - "laminas/laminas-validator": "^2.41", - "laminas/laminas-view": "^2.32", - "phpunit/phpunit": "^10.4.2", + "laminas/laminas-eventmanager": "^3.13", + "laminas/laminas-filter": "^2.34", + "laminas/laminas-validator": "^2.46", + "laminas/laminas-view": "^2.33", + "phpunit/phpunit": "^10.5.5", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.18.0" }, "suggest": { "laminas/laminas-cache": "You should install this package to cache the translations", @@ -1683,7 +1683,7 @@ "type": "community_bridge" } ], - "time": "2023-12-22T15:51:21+00:00" + "time": "2024-01-04T13:49:00+00:00" }, { "name": "laminas/laminas-loader", @@ -1974,16 +1974,16 @@ }, { "name": "laminas/laminas-navigation", - "version": "2.19.0", + "version": "2.19.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-navigation.git", - "reference": "9d212fb17dbb2da4172a7248a67483ebe38ad3a7" + "reference": "2ef88f68066381698b528be7fdd001723458a479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-navigation/zipball/9d212fb17dbb2da4172a7248a67483ebe38ad3a7", - "reference": "9d212fb17dbb2da4172a7248a67483ebe38ad3a7", + "url": "https://api.github.com/repos/laminas/laminas-navigation/zipball/2ef88f68066381698b528be7fdd001723458a479", + "reference": "2ef88f68066381698b528be7fdd001723458a479", "shasum": "" }, "require": { @@ -2051,20 +2051,20 @@ "type": "community_bridge" } ], - "time": "2023-11-14T21:49:15+00:00" + "time": "2024-01-10T15:11:10+00:00" }, { "name": "laminas/laminas-paginator", - "version": "2.18.0", + "version": "2.18.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-paginator.git", - "reference": "caacfd2625bf354be32888dd55767c893b89d38f" + "reference": "6a03499a899fb8ba650594ddf4b4338d4235252a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/caacfd2625bf354be32888dd55767c893b89d38f", - "reference": "caacfd2625bf354be32888dd55767c893b89d38f", + "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/6a03499a899fb8ba650594ddf4b4338d4235252a", + "reference": "6a03499a899fb8ba650594ddf4b4338d4235252a", "shasum": "" }, "require": { @@ -2130,7 +2130,7 @@ "type": "community_bridge" } ], - "time": "2023-11-08T15:42:20+00:00" + "time": "2024-01-11T11:00:36+00:00" }, { "name": "laminas/laminas-permissions-acl", @@ -2327,16 +2327,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": { @@ -2407,7 +2407,7 @@ "type": "community_bridge" } ], - "time": "2024-01-03T12:43:04+00:00" + "time": "2024-01-17T11:31:50+00:00" }, { "name": "myclabs/deep-copy", @@ -3218,16 +3218,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.5", + "version": "10.5.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" + "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", + "reference": "0bd663704f0165c9e76fe4f06ffa6a1ca727fdbe", "shasum": "" }, "require": { @@ -3299,7 +3299,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.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.9" }, "funding": [ { @@ -3315,7 +3315,7 @@ "type": "tidelift" } ], - "time": "2023-12-27T15:13:52+00:00" + "time": "2024-01-22T14:35:40+00:00" }, { "name": "psalm/plugin-phpunit", @@ -4521,16 +4521,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -4540,11 +4540,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -4597,7 +4597,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-01-11T20:47:48+00:00" }, { "name": "symfony/console", @@ -5373,16 +5373,16 @@ }, { "name": "vimeo/psalm", - "version": "5.18.0", + "version": "5.20.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19" + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b113f3ed0259fd6e212d87c3df80eec95a6abf19", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", "shasum": "" }, "require": { @@ -5479,7 +5479,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2023-12-16T09:37:35+00:00" + "time": "2024-01-18T12:15:06+00:00" }, { "name": "webimpress/coding-standard", diff --git a/docs/book/v2/view-event.md b/docs/book/v2/view-event.md index ae3bb811c..b72d57129 100644 --- a/docs/book/v2/view-event.md +++ b/docs/book/v2/view-event.md @@ -1,7 +1,7 @@ # The ViewEvent laminas-view incorporates and utilizes a custom [laminas-eventmanager -Event](https://laminas.github.com/laminas-eventmanager) implementation, +Event](https://docs.laminas.dev/laminas-eventmanager/) implementation, `Laminas\View\ViewEvent`. This event is created during `Laminas\View\View::getEvent()` and is passed directly to all the events the `View` class triggers. diff --git a/psalm-baseline.xml b/psalm-baseline.xml index f9f7a4e2d..06fbd28f7 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $closingBracket @@ -62,6 +62,9 @@ data[$this->name]]]> pointers[$this->name]]]> + + getName + @@ -167,7 +170,6 @@ $attributes[$itemKey] $href $index - $item autoEscape ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey]]]> autoEscape ? $this->escapeAttribute($value) : $value]]> $value @@ -197,6 +199,16 @@ $index view]]> + + createDataAlternate + createDataNext + createDataPrev + createDataStylesheet + + + AbstractContainer + AbstractContainer + (string) $conditionalStylesheet @@ -261,6 +273,10 @@ plugin plugin + + AbstractContainer + AbstractContainer + plugin plugin @@ -299,6 +315,10 @@ parent::__call($method, $args) parent::__call($method, $args) + + AbstractContainer + AbstractContainer + (bool) $flag @@ -333,10 +353,22 @@ $content $index + + AbstractContainer + AbstractContainer + is_string($content) + + $indent + + + + + HelperInterface + @@ -345,6 +377,9 @@ $options + + $content + @@ -387,6 +422,9 @@ plugin + + __construct + (string) $template @@ -582,6 +620,13 @@ plugin + + + HelperInterface + HelperInterface + HelperInterface + + $relFlag @@ -629,6 +674,16 @@ null + + searchRelChapter + searchRelNext + searchRelPrev + searchRelSection + searchRelStart + searchRelSubsection + searchRevSection + searchRevSubsection + (int) $renderFlag @@ -658,6 +713,9 @@ + + bool + @@ -752,6 +810,10 @@ plugin plugin + + escapeLabels + setAddClassToListItem + (bool) $flag (bool) $flag @@ -935,6 +997,9 @@ parent::__invoke($name, $item) + + self + (string) $key @@ -1017,6 +1082,10 @@ $return + + __get + __set + (bool) $autoEscape (string) $string @@ -1042,6 +1111,9 @@ AbstractContainer + + $instance + (string) $key (string) $key @@ -1162,6 +1234,11 @@ $reuseMatchedParams + + + hasRoot + + null|ConfigInterface|ContainerInterface @@ -1174,7 +1251,6 @@ get('EventManager')]]> get('MvcTranslator')]]> get('Translator')]]> - get(TranslatorInterface::class)]]> $container @@ -1183,19 +1259,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]]> @@ -1251,6 +1323,18 @@ $captureTo + + + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + ModelInterface + + gettype($variables) @@ -1298,6 +1382,9 @@ $values + + $resolver + is_string($nameOrModel) @@ -1321,6 +1408,9 @@ $children $values + + $resolver + (bool) $mergeUnnamedChildren (string) $callback @@ -1380,7 +1470,6 @@ $variables - __file]]> $values @@ -1393,6 +1482,9 @@ __vars]]> resolve + + $config + (bool) $renderTrees @@ -1458,6 +1550,9 @@ + + TemplatePathStack + (bool) $flag (string) $defaultSuffix @@ -1510,6 +1605,9 @@ plugin + + $e + plugin @@ -1746,6 +1844,11 @@ offsetSetName + + + $key + + $escape($value) @@ -2252,11 +2355,6 @@ vars()->message]]> - - - data]]> - - 1337 @@ -2442,9 +2540,6 @@ TemplatePathStack::FAILURE_NOT_FOUND TemplatePathStack::FAILURE_NO_PATHS - - - @@ -2538,10 +2633,5 @@ null - - assertIsArray - assertIsArray - assertIsArray - 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 fde428fc0..0b7980fb9 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; @@ -101,7 +102,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 = '