Skip to content

Commit

Permalink
Psalm integration
Browse files Browse the repository at this point in the history
Signed-off-by: Shankar Konar <[email protected]>
  • Loading branch information
konarshankar07 committed Oct 9, 2021
1 parent c34b15f commit 3955ea2
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="bin"/>
<directory name="src"/>
<directory name="test"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>

<issueHandlers>
<InternalMethod>
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::method"/>
</errorLevel>
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn"/>
</errorLevel>
<errorLevel type="suppress">
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::with"/>
</errorLevel>
</InternalMethod>
</issueHandlers>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
</plugins>
</psalm>
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
110 changes: 110 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.10.0@916b098b008f6de4543892b1e0651c1c3b92cbfa">
<file src="src/Helper/FlashMessenger.php">
<UndefinedDocblockClass occurrences="7">
<code>$flashMessenger</code>
<code>$flashMessenger</code>
<code>$flashMessenger</code>
<code>FlashMessenger|V2PluginFlashMessenger|PluginFlashMessenger</code>
<code>V2PluginFlashMessenger|PluginFlashMessenger</code>
<code>V2PluginFlashMessenger|PluginFlashMessenger</code>
<code>V2PluginFlashMessenger|PluginFlashMessenger</code>
</UndefinedDocblockClass>
</file>
<file src="src/Helper/HeadLink.php">
<ParamNameMismatch occurrences="1">
<code>$index</code>
</ParamNameMismatch>
</file>
<file src="src/Helper/HeadMeta.php">
<ParamNameMismatch occurrences="2">
<code>$index</code>
<code>$index</code>
</ParamNameMismatch>
</file>
<file src="src/Helper/HeadScript.php">
<ParamNameMismatch occurrences="1">
<code>$index</code>
</ParamNameMismatch>
</file>
<file src="src/Helper/HeadStyle.php">
<ParamNameMismatch occurrences="1">
<code>$index</code>
</ParamNameMismatch>
</file>
<file src="src/Helper/HtmlList.php">
<InvalidParamDefault occurrences="1">
<code>array</code>
</InvalidParamDefault>
</file>
<file src="src/Helper/Navigation.php">
<InvalidThrow occurrences="2">
<code>\Laminas\Navigation\Exception\ExceptionInterface</code>
<code>\Laminas\View\Exception\ExceptionInterface</code>
</InvalidThrow>
</file>
<file src="src/Helper/Navigation/AbstractHelper.php">
<InvalidThrow occurrences="1">
<code>Navigation\Exception\ExceptionInterface</code>
</InvalidThrow>
<ParamNameMismatch occurrences="1">
<code>$events</code>
</ParamNameMismatch>
</file>
<file src="src/Helper/Navigation/HelperInterface.php">
<InvalidThrow occurrences="2">
<code>\Laminas\View\Exception\ExceptionInterface</code>
<code>\Laminas\View\Exception\ExceptionInterface</code>
</InvalidThrow>
</file>
<file src="src/Helper/Navigation/Links.php">
<InvalidThrow occurrences="1">
<code>Exception\ExceptionInterface</code>
</InvalidThrow>
</file>
<file src="src/Helper/Navigation/PluginManager.php">
<UndefinedDocblockClass occurrences="1">
<code>null|ConfigInterface|ContainerInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Helper/Service/FlashMessengerFactory.php">
<ParamNameMismatch occurrences="1">
<code>$container</code>
</ParamNameMismatch>
</file>
<file src="src/HelperPluginManager.php">
<UndefinedDocblockClass occurrences="1">
<code>null|ConfigInterface|ContainerInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Renderer/ConsoleRenderer.php">
<ParamNameMismatch occurrences="1">
<code>$model</code>
</ParamNameMismatch>
</file>
<file src="src/View.php">
<AssignmentToVoid occurrences="1">
<code>$result</code>
</AssignmentToVoid>
<ParamNameMismatch occurrences="1">
<code>$events</code>
</ParamNameMismatch>
</file>
<file src="vendor/laminas/laminas-servicemanager/src/Exception/CyclicAliasException.php">
<ParseError occurrences="7">
<code>)</code>
<code>,</code>
<code>,</code>
<code>:</code>
<code>=&gt;</code>
<code>fn</code>
<code>fn</code>
</ParseError>
</file>
<file src="vendor/laminas/laminas-servicemanager/src/ServiceManager.php">
<ParseError occurrences="2">
<code>=&gt;</code>
<code>fn</code>
</ParseError>
</file>
</files>
16 changes: 16 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

0 comments on commit 3955ea2

Please sign in to comment.