From 3955ea2e1f99bf35ccf54164004feca5e8871793 Mon Sep 17 00:00:00 2001 From: Shankar Konar Date: Sat, 9 Oct 2021 21:13:17 +0530 Subject: [PATCH] Psalm integration Signed-off-by: Shankar Konar --- .psalm.xml.dist | 33 ++++++++++++++ .travis.yml | 1 + composer.json | 4 +- psalm-baseline.xml | 110 +++++++++++++++++++++++++++++++++++++++++++++ psalm.xml | 16 +++++++ 5 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 .psalm.xml.dist create mode 100644 psalm-baseline.xml create mode 100644 psalm.xml diff --git a/.psalm.xml.dist b/.psalm.xml.dist new file mode 100644 index 000000000..b9d94f777 --- /dev/null +++ b/.psalm.xml.dist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f9d8e3877..668267f58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,6 +52,7 @@ install: script: - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi after_script: - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi diff --git a/composer.json b/composer.json index 4b96dca6f..ead6b5edb 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,8 @@ "laminas/laminas-json": "^2.6.1 || ^3.0", "laminas/laminas-loader": "^2.5", "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0" + "laminas/laminas-zendframework-bridge": "^1.0", + "vimeo/psalm": "^4.10" }, "require-dev": { "laminas/laminas-authentication": "^2.5", @@ -93,6 +94,7 @@ ], "cs-check": "phpcs", "cs-fix": "phpcbf", + "static-analysis": "psalm --shepherd --stats", "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" }, diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 000000000..7e06c4eac --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,110 @@ + + + + + $flashMessenger + $flashMessenger + $flashMessenger + FlashMessenger|V2PluginFlashMessenger|PluginFlashMessenger + V2PluginFlashMessenger|PluginFlashMessenger + V2PluginFlashMessenger|PluginFlashMessenger + V2PluginFlashMessenger|PluginFlashMessenger + + + + + $index + + + + + $index + $index + + + + + $index + + + + + $index + + + + + array + + + + + \Laminas\Navigation\Exception\ExceptionInterface + \Laminas\View\Exception\ExceptionInterface + + + + + Navigation\Exception\ExceptionInterface + + + $events + + + + + \Laminas\View\Exception\ExceptionInterface + \Laminas\View\Exception\ExceptionInterface + + + + + Exception\ExceptionInterface + + + + + null|ConfigInterface|ContainerInterface + + + + + $container + + + + + null|ConfigInterface|ContainerInterface + + + + + $model + + + + + $result + + + $events + + + + + ) + , + , + : + => + fn + fn + + + + + => + fn + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 000000000..86fd1f493 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + +