Skip to content

Commit a3b4718

Browse files
Improved static analysis
1 parent 70d6d9d commit a3b4718

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/phpstan.src.neon.dist export-ignore
1111
/phpstan.tests.neon.dist export-ignore
1212
/phpunit.xml.dist export-ignore
13+
/psalm-baseline.xml export-ignore
1314
/psalm.xml export-ignore
1415
/README.md export-ignore
1516
/UPGRADING.md export-ignore

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ phpstan-analyze-tests:
1414
psalm-analyze:
1515
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
1616

17+
psalm-baseline:
18+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --set-baseline=psalm-baseline.xml
19+
1720
psalm-show-info:
1821
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true
1922

psalm-baseline.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="4.2.1@ea9cb72143b77e7520c52fa37290bd8d8bc88fd9">
3+
<file src="src/Parser/EntryParser.php">
4+
<MissingClosureReturnType occurrences="1">
5+
<code>static function (array $data) {</code>
6+
</MissingClosureReturnType>
7+
</file>
8+
<file src="src/Repository/RepositoryBuilder.php">
9+
<InvalidStringClass occurrences="3">
10+
<code>$adapter::create()</code>
11+
<code>$reader::create()</code>
12+
<code>$writer::create()</code>
13+
</InvalidStringClass>
14+
<MissingClosureReturnType occurrences="3">
15+
<code>static function ($adapter) {</code>
16+
<code>static function ($reader) {</code>
17+
<code>static function ($writer) {</code>
18+
</MissingClosureReturnType>
19+
</file>
20+
<file src="src/Util/Regex.php">
21+
<UndefinedFunction occurrences="1">
22+
<code>\preg_last_error_msg()</code>
23+
</UndefinedFunction>
24+
</file>
25+
</files>

psalm.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0"?>
22
<psalm
3-
errorLevel="4"
3+
errorLevel="2"
44
resolveFromConfigFile="true"
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
errorBaseline="psalm-baseline.xml"
89
>
910
<projectFiles>
1011
<directory name="src" />

vendor-bin/phpstan/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"phpstan/phpstan": "0.12.58",
44
"phpstan/extension-installer": "1.0.5",
55
"phpstan/phpstan-deprecation-rules": "0.12.5",
6-
"phpstan/phpstan-phpunit": "~0.12.11",
6+
"phpstan/phpstan-phpunit": "0.12.16",
77
"phpstan/phpstan-strict-rules": "0.12.5",
88
"thecodingmachine/phpstan-strict-rules": "0.12.1"
99
},

0 commit comments

Comments
 (0)