Integrate PHPStan analysis (#1)

This commit is contained in:
Ondřej Mirtes 2017-11-20 08:05:03 +01:00 committed by Jan Tvrdík
parent 4e272700b3
commit 3fed7e24cb
3 changed files with 25 additions and 1 deletions

View File

@ -6,7 +6,8 @@
composer-install,
lint,
cs,
tests
tests,
phpstan
"/>
<target name="composer-validate">
@ -95,4 +96,19 @@
<arg path="tests"/>
</exec>
</target>
<target name="phpstan">
<exec
executable="vendor/bin/phpstan"
logoutput="true"
passthru="true"
checkreturn="true"
>
<arg value="analyse"/>
<arg value="--level"/>
<arg value="7"/>
<arg path="src"/>
<arg path="tests"/>
</exec>
</target>
</project>

View File

@ -2,6 +2,8 @@
"name": "phpstan/phpdoc-parser",
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"license": "MIT",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "~7.0"
},
@ -9,10 +11,14 @@
"consistence/coding-standard": "^2.0.0",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phing/phing": "^2.16.0",
"phpstan/phpstan": "^0.9",
"phpunit/phpunit": "^6.3",
"slevomat/coding-standard": "^3.3.0"
},
"autoload": {
"psr-4": {"PHPStan\\PhpDocParser\\": ["src/"]}
},
"autoload-dev": {
"psr-4": {"PHPStan\\PhpDocParser\\": ["tests/PHPStan"]}
}
}

View File

@ -86,6 +86,8 @@ class Lexer
}
preg_match_all($this->regexp, $s, $tokens, PREG_SET_ORDER);
assert($this->types !== null);
$count = count($this->types);
foreach ($tokens as &$match) {