From 3d6c02aeaa9f3742ad360e4b51931d3096797c5d Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 29 May 2023 10:30:36 +0100 Subject: [PATCH] qa: Fix minor psalm issues to keep CI green and bump dev deps Signed-off-by: George Steel --- composer.json | 6 +- composer.lock | 191 ++++---- phpcs.xml | 2 +- psalm-baseline.xml | 580 +++++++++++------------ src/Helper/Navigation/AbstractHelper.php | 5 +- test/Model/ViewModelTest.php | 4 +- 6 files changed, 378 insertions(+), 410 deletions(-) diff --git a/composer.json b/composer.json index 0bdd9f382..54531b147 100644 --- a/composer.json +++ b/composer.json @@ -49,12 +49,12 @@ "laminas/laminas-mvc-plugin-flashmessenger": "^1.9", "laminas/laminas-navigation": "^2.18.1", "laminas/laminas-paginator": "^2.17", - "laminas/laminas-permissions-acl": "^2.13", + "laminas/laminas-permissions-acl": "^2.14", "laminas/laminas-router": "^3.11.1", "laminas/laminas-uri": "^2.10", - "phpunit/phpunit": "^9.5.28", + "phpunit/phpunit": "^9.6.3", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.4" + "vimeo/psalm": "^5.7.1" }, "conflict": { "container-interop/container-interop": "<1.2", diff --git a/composer.lock b/composer.lock index 2277a0e53..46f6118c4 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": "dd2ee7c1a95d1b511f67a0eda4ea68ce", + "content-hash": "c4e79f4cfb9afcc71764a7bdca4c30b8", "packages": [ { "name": "laminas/laminas-escaper", @@ -1671,16 +1671,16 @@ }, { "name": "laminas/laminas-i18n", - "version": "2.21.0", + "version": "2.22.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-i18n.git", - "reference": "fbd2d0373aaced4769cba2bf3d1425d55f68abb1" + "reference": "075bec49f777698c6fc229eecefbe7a2364cd18e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/fbd2d0373aaced4769cba2bf3d1425d55f68abb1", - "reference": "fbd2d0373aaced4769cba2bf3d1425d55f68abb1", + "url": "https://api.github.com/repos/laminas/laminas-i18n/zipball/075bec49f777698c6fc229eecefbe7a2364cd18e", + "reference": "075bec49f777698c6fc229eecefbe7a2364cd18e", "shasum": "" }, "require": { @@ -1698,7 +1698,7 @@ "laminas/laminas-cache": "^3.8", "laminas/laminas-cache-storage-adapter-memory": "^2.2.0", "laminas/laminas-cache-storage-deprecated-factory": "^1.0.1", - "laminas/laminas-coding-standard": "~2.4.0", + "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-config": "^3.8.0", "laminas/laminas-eventmanager": "^3.7", "laminas/laminas-filter": "^2.28.1", @@ -1753,7 +1753,7 @@ "type": "community_bridge" } ], - "time": "2022-12-02T17:15:52+00:00" + "time": "2023-03-31T12:31:38+00:00" }, { "name": "laminas/laminas-loader", @@ -1885,16 +1885,16 @@ }, { "name": "laminas/laminas-mvc", - "version": "3.6.0", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-mvc.git", - "reference": "c54eaebe3810feaca834cc38ef0a962c89ff2431" + "reference": "f12e801c31c04a4b35017354ff84070f5573879f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/c54eaebe3810feaca834cc38ef0a962c89ff2431", - "reference": "c54eaebe3810feaca834cc38ef0a962c89ff2431", + "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/f12e801c31c04a4b35017354ff84070f5573879f", + "reference": "f12e801c31c04a4b35017354ff84070f5573879f", "shasum": "" }, "require": { @@ -1902,8 +1902,8 @@ "laminas/laminas-eventmanager": "^3.4", "laminas/laminas-http": "^2.15", "laminas/laminas-modulemanager": "^2.8", - "laminas/laminas-router": "^3.5", - "laminas/laminas-servicemanager": "^3.7", + "laminas/laminas-router": "^3.11.1", + "laminas/laminas-servicemanager": "^3.20.0", "laminas/laminas-stdlib": "^3.6", "laminas/laminas-view": "^2.14", "php": "~8.0.0 || ~8.1.0 || ~8.2.0" @@ -1912,14 +1912,12 @@ "zendframework/zend-mvc": "*" }, "require-dev": { - "http-interop/http-middleware": "^0.4.1", "laminas/laminas-coding-standard": "^2.4.0", "laminas/laminas-json": "^3.3", - "laminas/laminas-psr7bridge": "^1.8", - "laminas/laminas-stratigility": ">=2.0.1 <2.2", "phpspec/prophecy": "^1.15.0", "phpspec/prophecy-phpunit": "^2.0.1", - "phpunit/phpunit": "^9.5.25" + "phpunit/phpunit": "^9.5.25", + "webmozart/assert": "^1.11" }, "suggest": { "laminas/laminas-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable", @@ -1964,7 +1962,7 @@ "type": "community_bridge" } ], - "time": "2022-12-05T14:02:56+00:00" + "time": "2023-03-15T10:21:03+00:00" }, { "name": "laminas/laminas-mvc-i18n", @@ -2634,16 +2632,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -2681,7 +2679,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -2689,20 +2687,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.1.0", + "version": "v4.2.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" + "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", - "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", + "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", "shasum": "" }, "require": { @@ -2738,22 +2736,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" }, - "time": "2022-12-08T20:46:14+00:00" + "time": "2023-04-09T17:37:40+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.15.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", "shasum": "" }, "require": { @@ -2794,9 +2792,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-05-19T20:20:00+00:00" }, { "name": "phar-io/manifest", @@ -3120,23 +3118,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", + "version": "9.2.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -3151,8 +3149,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { @@ -3185,7 +3183,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" }, "funding": [ { @@ -3193,7 +3191,7 @@ "type": "github" } ], - "time": "2023-01-26T08:26:55+00:00" + "time": "2023-03-06T12:58:08+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3438,16 +3436,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.3", + "version": "9.6.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" + "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", "shasum": "" }, "require": { @@ -3480,8 +3478,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -3520,7 +3518,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" }, "funding": [ { @@ -3536,7 +3535,7 @@ "type": "tidelift" } ], - "time": "2023-02-04T13:37:15+00:00" + "time": "2023-05-11T05:14:45+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3600,25 +3599,25 @@ }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -3647,9 +3646,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/log", @@ -4001,16 +4000,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -4055,7 +4054,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -4063,7 +4062,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", @@ -4728,16 +4727,16 @@ }, { "name": "spatie/array-to-xml", - "version": "3.1.5", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "13f76acef5362d15c71ae1ac6350cc3df5e25e43" + "reference": "e210b98957987c755372465be105d32113f339a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/13f76acef5362d15c71ae1ac6350cc3df5e25e43", - "reference": "13f76acef5362d15c71ae1ac6350cc3df5e25e43", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/e210b98957987c755372465be105d32113f339a4", + "reference": "e210b98957987c755372465be105d32113f339a4", "shasum": "" }, "require": { @@ -4775,7 +4774,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.1.5" + "source": "https://github.com/spatie/array-to-xml/tree/3.1.6" }, "funding": [ { @@ -4787,20 +4786,20 @@ "type": "github" } ], - "time": "2022-12-24T13:43:51+00:00" + "time": "2023-05-11T14:04:07+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -4836,14 +4835,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", @@ -5620,22 +5620,22 @@ }, { "name": "vimeo/psalm", - "version": "5.7.1", + "version": "5.12.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "8e0fd880141f236847ab49a06f94f788d41a4292" + "reference": "f90118cdeacd0088e7215e64c0c99ceca819e176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/8e0fd880141f236847ab49a06f94f788d41a4292", - "reference": "8e0fd880141f236847ab49a06f94f788d41a4292", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/f90118cdeacd0088e7215e64c0c99ceca819e176", + "reference": "f90118cdeacd0088e7215e64c0c99ceca819e176", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.10.0", + "composer-runtime-api": "^2", "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", @@ -5650,7 +5650,7 @@ "felixfbecker/language-server-protocol": "^1.5.2", "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^4.14", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", "sebastian/diff": "^4.0 || ^5.0", "spatie/array-to-xml": "^2.17.0 || ^3.0", @@ -5661,6 +5661,7 @@ "psalm/psalm": "self.version" }, "require-dev": { + "amphp/phpunit-util": "^2.0", "bamarni/composer-bin-plugin": "^1.4", "brianium/paratest": "^6.9", "ext-curl": "*", @@ -5719,30 +5720,30 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.7.1" + "source": "https://github.com/vimeo/psalm/tree/5.12.0" }, - "time": "2023-02-20T00:48:41+00:00" + "time": "2023-05-22T21:19:03+00:00" }, { "name": "webimpress/coding-standard", - "version": "1.2.4", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/webimpress/coding-standard.git", - "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9" + "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", - "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", + "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/b26557e2386711ecb74f22718f4b4bde5ddbc899", + "reference": "b26557e2386711ecb74f22718f4b4bde5ddbc899", "shasum": "" }, "require": { "php": "^7.3 || ^8.0", - "squizlabs/php_codesniffer": "^3.6.2" + "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "phpunit/phpunit": "^9.5.13" + "phpunit/phpunit": "^9.6.4" }, "type": "phpcodesniffer-standard", "extra": { @@ -5768,7 +5769,7 @@ ], "support": { "issues": "https://github.com/webimpress/coding-standard/issues", - "source": "https://github.com/webimpress/coding-standard/tree/1.2.4" + "source": "https://github.com/webimpress/coding-standard/tree/1.3.1" }, "funding": [ { @@ -5776,7 +5777,7 @@ "type": "github" } ], - "time": "2022-02-15T19:52:12+00:00" + "time": "2023-03-09T15:05:18+00:00" }, { "name": "webimpress/safe-writer", diff --git a/phpcs.xml b/phpcs.xml index 328d189d5..81b4a2556 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,7 +7,7 @@ - + src test diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 2077143a3..c710e8bb4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,12 +1,12 @@ - + $templatePath $file - $file->getExtension() + getExtension()]]> $templatePath @@ -63,24 +63,24 @@ Iterator - $this->data[$this->name] - $this->data[$this->name] + data[$this->name]]]> + data[$this->name]]]> - $this->data[$this->name][$this->key()] - $this->data[$this->name][$this->key()] + data[$this->name][$this->key()]]]> + data[$this->name][$this->key()]]]> array int - $this->pointers[$this->name] - $this->pointers[$this->name] + pointers[$this->name]]]> + pointers[$this->name]]]> - $this->data[$this->name] - $this->pointers[$this->name] + data[$this->name]]]> + pointers[$this->name]]]> @@ -100,7 +100,7 @@ $vars - $vars->$key + $key]]> $view @@ -119,16 +119,16 @@ null === static::$registeredDoctypes - $this->registry['doctypes'][$type] + registry['doctypes'][$type]]]> array string - $doctypes[$this->getDoctype()] - $this->registry['doctype'] - $this->registry['doctypes'] + getDoctype()]]]> + registry['doctype']]]> + registry['doctypes']]]> $registry @@ -142,7 +142,7 @@ - null === $this->pluginFlashMessenger + pluginFlashMessenger]]> $item @@ -168,7 +168,7 @@ $classes $messagesToPrint[] $messagesToPrint[] - $this->escapeHtmlHelper + escapeHtmlHelper]]> (bool) $autoEscape @@ -177,7 +177,7 @@ (string) $messageSeparatorString - $this->escapeHtmlHelper + escapeHtmlHelper]]> @@ -202,10 +202,10 @@ string - $this->options['default_img'] - $this->options['img_size'] - $this->options['rating'] - $this->options['secure'] + options['default_img']]]> + options['img_size']]]> + options['rating']]]> + options['secure']]]> (bool) $flag @@ -220,7 +220,7 @@ $item - $this->getContainer()->set($value) + getContainer()->set($value)]]> HeadLink @@ -238,9 +238,9 @@ $index $item $item - $this->autoEscape ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey] - $this->autoEscape ? $this->escapeAttribute($value) : $value - $this->getSeparator() + autoEscape ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey]]]> + autoEscape ? $this->escapeAttribute($value) : $value]]> + getSeparator()]]> $value @@ -275,8 +275,8 @@ $indent - $item->href - $item->rel + href]]> + rel]]> call_user_func_array([$this, '__invoke'], func_get_args()) @@ -295,7 +295,7 @@ $index - $this->view + view]]> (string) $conditionalStylesheet @@ -324,14 +324,14 @@ $args[2] $index $item - $item->$type - $item->content - $item->type + $type]]> + content]]> + type]]> $key - $this->autoEscape ? $this->escapeAttribute($item->$type) : $item->$type - $this->autoEscape ? $this->escapeAttribute($item->content) : $item->content - $this->autoEscape ? $this->escapeAttribute($value) : $value - $this->getSeparator() + autoEscape ? $this->escapeAttribute($item->$type) : $item->$type]]> + autoEscape ? $this->escapeAttribute($item->content) : $item->content]]> + autoEscape ? $this->escapeAttribute($value) : $value]]> + getSeparator()]]> $type $value @@ -361,8 +361,8 @@ $indent - $item->type - $item->{$item->type} + type]]> + {$item->type}]]> parent::__call($method, $args) @@ -372,14 +372,14 @@ $value - $this->offsetSet($index, $item) + offsetSet($index, $item)]]> $index $index - $this->view + view]]> plugin @@ -408,13 +408,13 @@ $indent $index $index - $item->attributes - $item->attributes['conditional'] - $item->type - $item->type + attributes]]> + attributes['conditional']]]> + type]]> + type]]> $key - $this->autoEscape ? $this->escapeAttribute($value) : $value - $this->getSeparator() + autoEscape ? $this->escapeAttribute($value) : $value]]> + getSeparator()]]> $value @@ -425,7 +425,7 @@ $item $item $key - $this->captureType + captureType]]> $type $useCdata $value @@ -438,16 +438,16 @@ isXhtml - $item->attributes['conditional'] - $item->source + attributes['conditional']]]> + source]]> $type - $item->attributes - $item->attributes - $item->source - $item->source - $item->type + attributes]]> + attributes]]> + source]]> + source]]> + type]]> parent::__call($method, $args) @@ -468,7 +468,7 @@ (bool) $flag - (null !== $spec) && is_string($spec) + is_string($spec) @@ -486,20 +486,19 @@ $content $enc - $escaper->escapeHtmlAttr($value) + escapeHtmlAttr($value)]]> $indent $index $item - $item->attributes['conditional'] + attributes['conditional']]]> $key $value - $value $attributes['media'] - $item->attributes['conditional'] + attributes['conditional']]]> $content @@ -517,8 +516,8 @@ $indent $indent - $item->attributes['conditional'] - $item->content + attributes['conditional']]]> + content]]> $index @@ -537,7 +536,7 @@ $captureType - (null !== $content) && is_string($content) + is_string($content) @@ -553,7 +552,7 @@ $item - static fn($item) => $item + $item]]> $item @@ -662,7 +661,7 @@ $value - $this->view + view]]> (bool) $useNamespaces @@ -689,7 +688,7 @@ null - $this->response instanceof Response + response instanceof Response]]> @@ -729,10 +728,10 @@ - ! is_int($this->minDepth) + minDepth)]]> ! is_string($message) $container instanceof AbstractContainer - null === $this->container + container]]> AbstractHelper @@ -763,8 +762,8 @@ $minDepth - $page->getTextDomain() - $page->getTextDomain() + getTextDomain()]]> + getTextDomain()]]> $container @@ -779,7 +778,7 @@ $label - $results->last() + last()]]> $events @@ -788,7 +787,7 @@ strrpos($prefix, '\\') - $page->getTitle() + getTitle()]]> $maxDepth @@ -798,7 +797,6 @@ attach getParent plugin - translate (bool) $renderInvisible @@ -806,10 +804,10 @@ (string) $indent - $this->acl === null && static::$defaultAcl !== null + acl === null && static::$defaultAcl !== null]]> is_int($maxDepth) is_int($minDepth) - null !== $this->container + container]]> static::$defaultAcl !== null @@ -830,8 +828,8 @@ null === $partial - $this->renderPartialModel($params, $container, $partial) - $this->renderPartialModel([], $container, $partial) + renderPartialModel($params, $container, $partial)]]> + renderPartialModel([], $container, $partial)]]> string @@ -842,8 +840,8 @@ $active - $active->getLabel() - $active->getTextDomain() + getLabel()]]> + getTextDomain()]]> $model['pages'] $partial[0] @@ -908,7 +906,7 @@ $intermediate $page $page - $page->$meth() + $meth()]]> $type @@ -948,7 +946,7 @@ (int) $renderFlag - $this->root + root]]> null === $container @@ -979,8 +977,8 @@ null === $partial - $this->renderPartialModel($params, $container, $partial) - $this->renderPartialModel([], $container, $partial) + renderPartialModel($params, $container, $partial)]]> + renderPartialModel([], $container, $partial)]]> string @@ -1008,8 +1006,8 @@ $options['ulClass'] $page $page - $page->getTextDomain() - $page->getTextDomain() + getTextDomain()]]> + getTextDomain()]]> $partial[0] $subPage @@ -1052,7 +1050,7 @@ $container - $page->getTitle() + getTitle()]]> $minDepth @@ -1115,7 +1113,7 @@ $page $priority $serverUrlHelper - $this->serverUrl + serverUrl]]> $basePathHelper() @@ -1128,8 +1126,8 @@ $escaper($string) - $this->serverUrl - $this->serverUrl + serverUrl]]> + serverUrl]]> $container @@ -1155,7 +1153,7 @@ (string) $href - isset($this->serverUrl) + serverUrl)]]> plugin @@ -1184,7 +1182,7 @@ $partialHelper($partial[0], $pages) - $this->view->paginator + view->paginator]]> plugin @@ -1232,13 +1230,13 @@ $item - $this->objectKey + objectKey]]> array - $values->toArray() + toArray()]]> $name @@ -1256,16 +1254,16 @@ - new $this->containerClass($value) + containerClass($value)]]> - $this->items[$key] + items[$key]]]> AbstractContainer - $this->items + items]]> (string) $key @@ -1318,15 +1316,15 @@ (string) $separator - null !== $this->captureKey + captureKey]]> - new $this->containerClass() + containerClass()]]> - $this->container + container]]> ArrayAccess @@ -1345,8 +1343,8 @@ escapeHtmlAttr - $this->getEscaper()->escapeHtml((string) $string) - $this->getEscaper()->escapeHtmlAttr((string) $string) + getEscaper()->escapeHtml((string) $string)]]> + getEscaper()->escapeHtmlAttr((string) $string)]]> AbstractContainer @@ -1358,7 +1356,7 @@ null - new $this->containerClass() + containerClass()]]> (bool) $autoEscape @@ -1366,7 +1364,7 @@ (string) $string - null !== $this->container + container]]> @@ -1374,16 +1372,16 @@ null === static::$instance - new $this->containerClass($value) + containerClass($value)]]> - $this->items[$key] + items[$key]]]> AbstractContainer - $this->items[$key] + items[$key]]]> AbstractContainer @@ -1406,7 +1404,7 @@ $childModel - $this->viewModelHelper + viewModelHelper]]> ViewModel @@ -1417,13 +1415,13 @@ $childModel - $this->viewModelHelper + viewModelHelper]]> - $this->getView() + getView()]]> - $model = $this->getCurrent() + getCurrent()]]> getChildren @@ -1431,7 +1429,7 @@ render - $this->viewModelHelper + viewModelHelper]]> @@ -1464,8 +1462,8 @@ string - $this->host - $this->scheme + host]]> + scheme]]> $_SERVER['REQUEST_URI'] @@ -1544,7 +1542,7 @@ - 3 === func_num_args() && is_bool($options) + is_array($params) is_bool($options) @@ -1565,10 +1563,10 @@ ! $events - $container->get('EventManager') - $container->get('MvcTranslator') - $container->get('Translator') - $container->get(TranslatorInterface::class) + get('EventManager')]]> + get('MvcTranslator')]]> + get('Translator')]]> + get(TranslatorInterface::class)]]> $container @@ -1591,8 +1589,8 @@ parent::get($name, $options) - $this->initializers - $this->initializers + initializers]]> + initializers]]> getServiceLocator @@ -1623,7 +1621,7 @@ int - $this->options['errorLevel'] + options['errorLevel']]]> $captureTo @@ -1631,15 +1629,15 @@ - $this->type - $this->type + type]]> + type]]> false|string - $this->type - $this->type + type]]> + type]]> $variables @@ -1648,7 +1646,7 @@ $feed - $this->feed instanceof Feed + feed instanceof Feed]]> @@ -1689,7 +1687,7 @@ getChildrenByCaptureTo - $child->getChildrenByCaptureTo($capture) + getChildrenByCaptureTo($capture)]]> $children @@ -1698,9 +1696,6 @@ $variables[$name] - - $variables - (bool) $append (bool) $terminate @@ -1729,7 +1724,7 @@ $setting - $this->getFilterChain()->filter($values['result']) + getFilterChain()->filter($values['result'])]]> $model @@ -1791,7 +1786,7 @@ ! is_object($nameOrModel) - null !== $this->jsonpCallback + jsonpCallback]]> @@ -1804,9 +1799,9 @@ $__vars - $this->__template - $this->__template - array_pop($this->__varsCache) + __template]]> + __template]]> + __varsCache)]]> $vars[$name] @@ -1816,14 +1811,14 @@ $vars[$name] - $this->__vars[$key] - $this->__vars[$key] + __vars[$key]]]> + __vars[$key]]]> $includeReturn $setting - $this->__template - $this->__vars + __template]]> + __vars]]> $value $value $variablesAsArray[$key] @@ -1834,7 +1829,7 @@ $vars[$name] - clone $this->vars() + vars()]]> string @@ -1848,29 +1843,29 @@ $setting - $this->__filterChain->filter($this->__content) - $this->__templateResolver->resolve($name, $this) + __filterChain->filter($this->__content)]]> + __templateResolver->resolve($name, $this)]]> - $this->__templateResolver + __templateResolver]]> $variables - $this->__file + __file]]> $values - $this->resolver($this->__template) + resolver($this->__template)]]> - $this->__vars[$key] - $this->__vars[$key] + __vars[$key]]]> + __vars[$key]]]> - $this->__vars - $this->__vars + __vars]]> + __vars]]> resolve @@ -1881,7 +1876,7 @@ is_object($variables) - include $this->__file + __file]]> @@ -1891,9 +1886,9 @@ $resolver $resource - $this->lastLookupFailure - $this->lastLookupFailure - $this->lastSuccessfulResolver + lastLookupFailure]]> + lastLookupFailure]]> + lastSuccessfulResolver]]> false|string @@ -1921,8 +1916,8 @@ - ! is_array($map) && ! $map instanceof Traversable - ! is_array($map) && ! $map instanceof Traversable + + is_string($nameOrMap) @@ -1932,7 +1927,7 @@ false|string - $this->map[$name] + map[$name]]]> @@ -1950,12 +1945,12 @@ $value - $this->lastLookupFailure - $this->lastLookupFailure + lastLookupFailure]]> + lastLookupFailure]]> $value - $this->paths + paths]]> (bool) $flag @@ -2027,9 +2022,9 @@ $whence - $this->pos - $this->pos - $this->pos + pos]]> + pos]]> + pos]]> $offset @@ -2043,9 +2038,6 @@ - - ArrayIterator::class - Variables @@ -2126,7 +2118,7 @@ - (string) $this->helper->toString() + helper->toString()]]> @@ -2143,15 +2135,15 @@ $vars - $vars->varName1 - $vars->varName1 - $vars->varName2 - $vars->varName2 - $vars->varName3 - $vars->varName3 - $vars->varName4 - $vars->varName4 - $vars->varName5 + varName1]]> + varName1]]> + varName2]]> + varName2]]> + varName3]]> + varName3]]> + varName4]]> + varName4]]> + varName5]]> addPath @@ -2204,7 +2196,7 @@ $plugin $plugin - $this->mvcPluginClass + mvcPluginClass]]> FlashMessenger @@ -2327,17 +2319,17 @@ $attributeEscaper('/foo/bar') - $item->conditionalStylesheet - $item->conditionalStylesheet - $item->conditionalStylesheet - $item->conditionalStylesheet - $item->conditionalStylesheet - $item->media - $link->href - $link->href - $value->href - $value->href - $value->href + conditionalStylesheet]]> + conditionalStylesheet]]> + conditionalStylesheet]]> + conditionalStylesheet]]> + conditionalStylesheet]]> + media]]> + href]]> + href]]> + href]]> + href]]> + href]]> appendNext @@ -2377,9 +2369,9 @@ $item $item $item - $item->type - $item->type - $item->type + type]]> + type]]> + type]]> $modifiers $modifiers $value @@ -2418,22 +2410,22 @@ $attributeEscaper('foo bar') - $item->content - $item->content - $item->content - $item->content - $item->content - $item->name - $item->name - $item->type - $item->type - $item->type - $item->type - $item->type - $item->{$item->type} - $item->{$item->type} - $item->{$item->type} - $value->modifiers + content]]> + content]]> + content]]> + content]]> + content]]> + name]]> + name]]> + type]]> + type]]> + type]]> + type]]> + type]]> + {$item->type}]]> + {$item->type}]]> + {$item->type}]]> + modifiers]]> getArrayCopy @@ -2463,7 +2455,7 @@ $item $item $item - $item->source + source]]> $values $values $values @@ -2473,20 +2465,20 @@ $values - $first->attributes['src'] + attributes['src']]]> $items[$i] $values[$i] $values[$i] $values[$i] - $values[$i]->attributes['src'] + attributes['src']]]> $values[0] $values[0] $values[0] - $values[0]->attributes['src'] + attributes['src']]]> $values[5] $values[5] $values[5] - $values[5]->attributes['src'] + attributes['src']]]> $first @@ -2500,25 +2492,25 @@ $values - Generator<string, array<int, string> + ]]> - $first->attributes - $first->source - $first->type - $item->attributes - $item->source - $item->source - $item->source - $values[$i]->attributes - $values[$i]->source - $values[$i]->type - $values[0]->attributes - $values[0]->source - $values[0]->type - $values[5]->attributes - $values[5]->source - $values[5]->type + attributes]]> + source]]> + type]]> + attributes]]> + source]]> + source]]> + source]]> + attributes]]> + source]]> + type]]> + attributes]]> + source]]> + type]]> + attributes]]> + source]]> + type]]> getArrayCopy @@ -2533,8 +2525,8 @@ - $item->content - $item->content + content]]> + content]]> $value $values $values @@ -2544,9 +2536,9 @@ $values $values $values - $values[0]->content - $values[1]->content - $values[2]->content + content]]> + content]]> + content]]> $values[$i] @@ -2565,12 +2557,12 @@ $values - $item->content - $item->content - $value->attributes - $values[0]->content - $values[1]->content - $values[2]->content + content]]> + content]]> + attributes]]> + content]]> + content]]> + content]]> bogusMethod @@ -2610,7 +2602,7 @@ $acl $acl - $this->serviceManager->get('Navigation') + serviceManager->get('Navigation')]]> $acl @@ -2622,7 +2614,7 @@ $_helper - $this->_helper + _helper]]> @@ -2824,9 +2816,9 @@ - function (int $code, string $message) { - $this->errorHandlerMessage = $message; - } + errorHandlerMessage = $message; + }]]> $acl['acl'] @@ -2847,20 +2839,17 @@ $_helper - $this->errorHandlerMessage + errorHandlerMessage]]> - new Page\Uri([ - 'resource' => 'unknownresource', - 'privilege' => 'someprivilege', - ], false) + 'unknownresource', + 'privilege' => 'someprivilege', + ], false)]]> PsrContainerDecorator - - $code - @@ -2880,20 +2869,20 @@ plugin - $nav = clone $this->nav2; - $nav->addPage(['label' => 'Invalid', 'uri' => 'http://w.']); - static::fail('A Laminas\View\Exception\InvalidArgumentException was not thrown on invalid <loc />'); - try { - $this->_helper->render($nav); + nav2;]]> + addPage(['label' => 'Invalid', 'uri' => 'http://w.']);]]> + ');]]> + _helper->render($nav); } catch (View\Exception\ExceptionInterface $e) { $expected = sprintf( 'Encountered an invalid URL for Sitemap XML: "%s"', 'http://w.' ); - $actual = $e->getMessage(); + $actual = $e->getMessage(); static::assertEquals($expected, $actual); return; - } + }]]> @@ -2942,10 +2931,10 @@ $value - $item->message - $item->message - $item->objectKey - $item->objectKey + message]]> + message]]> + objectKey]]> + objectKey]]> $value $value @@ -3054,8 +3043,8 @@ addPath - $item->message - $item->message + message]]> + message]]> $data @@ -3082,11 +3071,11 @@ $value - $view->vars() + vars()]]> - $model->getVariables() - $model->getVariables() + getVariables()]]> + getVariables()]]> $return @@ -3131,7 +3120,7 @@ - $container->data + data]]> @@ -3142,7 +3131,7 @@ - $this->translations + translations]]> @@ -3165,6 +3154,9 @@ $value + + AllowDynamicProperties + @@ -3194,7 +3186,7 @@ $urlHelper('test') - $urlHelper('test', [], ['force_canonical' => true]) + true])]]> bootstrap @@ -3228,7 +3220,7 @@ $target - Generator<mixed, array{0: mixed, 1: mixed}, mixed, void> + ]]> @@ -3252,34 +3244,6 @@ new stdClass() new stdClass() - - [ - // variables default expected - - // if it is set always get the value - [['foo' => 'bar'], 'baz', 'bar'], - [['foo' => 'bar'], null, 'bar'], - [new ArrayObject(['foo' => 'bar']), 'baz', 'bar'], - [new ArrayObject(['foo' => 'bar']), null, 'bar'], - - // if it is null always get null value - [['foo' => null], null, null], - [['foo' => null], 'baz', null], - [new ArrayObject(['foo' => null]), null, null], - [new ArrayObject(['foo' => null]), 'baz', null], - - // when it is not set always get default value - [[], 'baz', 'baz'], - [new ArrayObject(), 'baz', 'baz'], - ] - - - array<array-key, array{ - * 0: array<string, null|string>|ArrayObject<string, null|string>, - * 1: null|string, - * 2: null|string - * }> - $variables['foo'] @@ -3302,7 +3266,7 @@ getArrayCopy - $this->renderer->vars()->foo + renderer->vars()->foo]]> $vars['foo'] @@ -3354,12 +3318,12 @@ - $headers->get('content-type')->getFieldValue() - $headers->get('content-type')->getFieldValue() - $headers->get('content-type')->getFieldValue() - $headers->get('content-type')->getFieldValue() - $headers->get('content-type')->getFieldValue() - $headers->get('content-type')->getFieldValue() + get('content-type')->getFieldValue()]]> + get('content-type')->getFieldValue()]]> + get('content-type')->getFieldValue()]]> + get('content-type')->getFieldValue()]]> + get('content-type')->getFieldValue()]]> + get('content-type')->getFieldValue()]]> $content @@ -3433,8 +3397,8 @@ $e - $result->content - $this->result->content + content]]> + result->content]]> $result[] diff --git a/src/Helper/Navigation/AbstractHelper.php b/src/Helper/Navigation/AbstractHelper.php index 39f5babd4..cfc4d446c 100644 --- a/src/Helper/Navigation/AbstractHelper.php +++ b/src/Helper/Navigation/AbstractHelper.php @@ -9,6 +9,7 @@ use Laminas\EventManager\EventManagerAwareInterface; use Laminas\EventManager\EventManagerInterface; use Laminas\EventManager\SharedEventManager; +use Laminas\I18n\Translator\TranslatorInterface; use Laminas\Navigation; use Laminas\Navigation\AbstractContainer; use Laminas\Navigation\Page\AbstractPage; @@ -21,6 +22,7 @@ use RecursiveIteratorIterator; use ReflectionClass; +use function assert; use function call_user_func_array; use function gettype; use function in_array; @@ -432,7 +434,7 @@ public function htmlify(AbstractPage $page) protected function translate($message, $textDomain = null) { if (! is_string($message) || empty($message)) { - return $message; + return ''; } if (! $this->isTranslatorEnabled() || ! $this->hasTranslator()) { @@ -440,6 +442,7 @@ protected function translate($message, $textDomain = null) } $translator = $this->getTranslator(); + assert($translator instanceof TranslatorInterface); $textDomain = $textDomain ?: $this->getTranslatorTextDomain(); return $translator->translate($message, $textDomain); diff --git a/test/Model/ViewModelTest.php b/test/Model/ViewModelTest.php index 234b78c37..a2a66922f 100644 --- a/test/Model/ViewModelTest.php +++ b/test/Model/ViewModelTest.php @@ -364,9 +364,9 @@ public function testCloneWithArray(): void /** * @psalm-return array|ArrayObject, + * 0: array|ArrayObject|ArrayObject, * 1: null|string, - * 2: null|string + * 2: null|string, * }> */ public function variableValue(): array