From 5afbed04e03a52ebe64f0712779d8efadba40f70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:08:55 +0000 Subject: [PATCH 1/2] Update dependency psalm/plugin-phpunit to ^0.19.0 | datasource | package | from | to | | ---------- | -------------------- | ------ | ------ | | packagist | psalm/plugin-phpunit | 0.18.4 | 0.19.0 | Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index ff45d4f..509906b 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "laminas/laminas-stdlib": "^3.16.1", "laminas/laminas-validator": "^2.28", "mikey179/vfsstream": "^1.6.11", - "psalm/plugin-phpunit": "^0.18.4", + "psalm/plugin-phpunit": "^0.19.0", "vimeo/psalm": "^5.26" }, "autoload": { diff --git a/composer.lock b/composer.lock index 9508eb9..69bd28d 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": "eb54de0fbc75b1f57294760ec7ebd642", + "content-hash": "2a18a69eaaf988791f0ddc22d68768fe", "packages": [ { "name": "brick/varexporter", @@ -4655,24 +4655,24 @@ }, { "name": "psalm/plugin-phpunit", - "version": "0.18.4", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc" + "reference": "e344eaaa27871e79c6cb97b9efe52a735f9d1966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", - "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e344eaaa27871e79c6cb97b9efe52a735f9d1966", + "reference": "e344eaaa27871e79c6cb97b9efe52a735f9d1966", "shasum": "" }, "require": { "composer/package-versions-deprecated": "^1.10", "composer/semver": "^1.4 || ^2.0 || ^3.0", "ext-simplexml": "*", - "php": "^7.1 || ^8.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.7.1 || ^5@beta || ^5.0" + "php": "^7.4 || ^8.0", + "vimeo/psalm": "dev-master || ^5@beta || ^5.0" }, "conflict": { "phpunit/phpunit": "<7.5" @@ -4709,9 +4709,9 @@ "description": "Psalm plugin for PHPUnit", "support": { "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.4" + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.19.0" }, - "time": "2022-12-03T07:47:07+00:00" + "time": "2024-03-15T10:43:15+00:00" }, { "name": "psr/log", From 661eb0301a4b3dea228a761d2761278dcac3c3b9 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 13 Sep 2024 02:26:04 +1000 Subject: [PATCH 2/2] Fix psalm issues Signed-off-by: Aleksei Khudiakov --- psalm-baseline.xml | 654 +++++++++--------- .../AbstractControllerTestCaseTest.php | 4 +- test/PHPUnit/Controller/MemoryLeakTest.php | 3 + 3 files changed, 329 insertions(+), 332 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 79bf61f..84a5d57 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ )]]> - getComparisonFailure + createFailureMessage($failedException->getMessage()), $failedException->getComparisonFailure(), @@ -23,43 +23,43 @@ get($controllerIdentifier)]]> - $controllerIdentifier - $controllerManager - $routeMatch + + + - get - getParam - getParam - getRouteMatch + + + + - getMvcEvent - getMvcEvent + + - $type + - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage + + + + + + + + + + + + + + + + + createFailureMessage( @@ -159,88 +159,88 @@ getApplication()->getServiceManager()]]> - $r + - $event - $event - $match - $match - $match - $match - $match - $method - $modulesLoaded - $modulesLoaded - $post - $query - $query - $viewModel + + + + + + + + + + + + + + - $list - $list + + - $event - $exception - $headers - $match - $match - $match - $match - $match - $method - $moduleManager - $moduleManager - $modulesLoaded - $modulesLoaded - $post - $query - $routeMatch - $routeMatch - $routeMatch - $routeMatch - $routeMatch - $routeMatch - $viewModel + + + + + + + + + + + + + + + + + + + + + + - addHeaderLine - detach - getError - getMatchedRouteName - getModules - getModules - getParam - getParam - getParam - getParam - getParam - getParam - getParam - getResponse - getRouteMatch - getRouteMatch - getRouteMatch - getRouteMatch - getRouteMatch - getRouteMatch - getViewModel - setName - setParam - toArray - toArray + + + + + + + + + + + + + + + + + + + + + + + + + - ServiceManager + - null + application]]> @@ -249,82 +249,82 @@ applicationConfig]]> - getTemplate + - getHeaders - getMethod - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getPost - getQuery - setMethod - setPost - setQuery - setRequestUri - setUri + + + + + + + + + + + + + + + + + + + + + - setExpectedException + - $pattern - $pattern - $pattern - $pattern - $pattern - $pattern - $pattern - $pattern - $pattern + + + + + + + + + - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage - createFailureMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + createFailureMessage( @@ -638,7 +638,7 @@ getResponse()->getHeaders()->get($header)]]> - HeaderInterface|false + getFieldValue()]]> @@ -648,54 +648,54 @@ getContent()]]> - $currentValue + - getFieldValue - getFieldValue - getFieldValue - getFieldValue - getFieldValue - getFieldValue - getFieldValue - getFieldValue + + + + + + + + nodeValue]]> - $currentHeader - $currentHeader - $currentHeader - $currentHeader - $node + + + + + - assertFalse - assertTrue - assertTrue + + + - assertFalse - assertFalse + + - $smConfig + - $module - $smConfig + + - Application - ModuleManager + + - loadModules + getServiceManager()->get('Application')]]> @@ -704,12 +704,12 @@ - $haystack - $haystack + + - $message - $message + + getRequest()->getContent()]]> @@ -721,41 +721,38 @@ - $config - $file + + - - Generator - - getError - setParam - setParam - toString + + + + - $config + - $message - $message + + - bool + - getMethod - getMethod - getMethod - getMvcEvent - getMvcEvent - getMvcEvent - getQuery - getRequestUri - setMethod - setMethod - setMethod - setMethod + + + + + + + + + + + + @@ -764,86 +761,83 @@ getChildren()]]> - $messages - $messages - $messages - $messages + + + + - $controller - $controller - $controller - $controller - $flashMessenger - $flashMessenger - $flashMessenger - $flashMessenger - $layout - $messages - $messages - $messages - $messages - $mvcEvent - $routeMatch - $routeMatch - $viewModel - $viewModel + + + + + + + + + + + + + + + + + + - flashMessenger - flashMessenger - flashMessenger - flashMessenger - get - get - get - get - getApplication - getChildren - getError - getMessages - getMessages - getMessages - getMessages - getParam - getParam - getParam - getPort - getResult - getResult - getRouteMatch - getTemplate - getTemplate - getTemplate - getViewModel - setParam - setParam - setPost - setQuery + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - getMethod - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getMvcEvent - getUri - isXmlHttpRequest - isXmlHttpRequest - isXmlHttpRequest - setMethod - setMethod + + + + + + + + + + + + + + - - array - - self::$memStart + @@ -857,136 +851,136 @@ - $baz - $baz - $baz - $baz - $file - $foo - $fooObject + + + + + + + - bool + - Module + - $numGet - $numPost + + - addHeaderLine - addHeaderLine - addMessage - get - get + + + + + $numGet, 'num_post' => $numPost]]]> ]]> - getHeaders - getPost - getQuery + + + - flashMessenger + - IndexController + - $e + - attach - getMatchedRouteName + + - Module + - $e + - getAutoloaderConfig - getConfig + + - IndexController + - Module + - IndexController + - Module + - IndexController + - $sm + - static function ($sm) { + - $foo + - get + - $foo + - Module + - IndexController + - $sm + - Module + - $sm + - IndexController + diff --git a/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php b/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php index 5e36cb6..9985e45 100644 --- a/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php +++ b/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php @@ -612,9 +612,9 @@ public function testRegisterNotExistingXpathNamespace(): void } /** - * @return Generator + * @return iterable */ - public static function routeParam() + public static function routeParam(): iterable { yield 'phpunit' => ['phpunit']; yield 'param' => ['param']; diff --git a/test/PHPUnit/Controller/MemoryLeakTest.php b/test/PHPUnit/Controller/MemoryLeakTest.php index 2fcd184..3eb974d 100644 --- a/test/PHPUnit/Controller/MemoryLeakTest.php +++ b/test/PHPUnit/Controller/MemoryLeakTest.php @@ -19,6 +19,9 @@ public static function setUpBeforeClass(): void self::$memStart = memory_get_usage(true); } + /** + * @return array + */ public static function dataForMultipleTests(): array { return array_fill(0, 100, [null]);