mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-12-02 09:28:02 +01:00
Integrate PHPStan analysis (#1)
This commit is contained in:
parent
4e272700b3
commit
3fed7e24cb
18
build.xml
18
build.xml
@ -6,7 +6,8 @@
|
|||||||
composer-install,
|
composer-install,
|
||||||
lint,
|
lint,
|
||||||
cs,
|
cs,
|
||||||
tests
|
tests,
|
||||||
|
phpstan
|
||||||
"/>
|
"/>
|
||||||
|
|
||||||
<target name="composer-validate">
|
<target name="composer-validate">
|
||||||
@ -95,4 +96,19 @@
|
|||||||
<arg path="tests"/>
|
<arg path="tests"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</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>
|
</project>
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
"name": "phpstan/phpdoc-parser",
|
"name": "phpstan/phpdoc-parser",
|
||||||
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
"description": "PHPDoc parser with support for nullable, intersection and generic types",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"prefer-stable": true,
|
||||||
"require": {
|
"require": {
|
||||||
"php": "~7.0"
|
"php": "~7.0"
|
||||||
},
|
},
|
||||||
@ -9,10 +11,14 @@
|
|||||||
"consistence/coding-standard": "^2.0.0",
|
"consistence/coding-standard": "^2.0.0",
|
||||||
"jakub-onderka/php-parallel-lint": "^0.9.2",
|
"jakub-onderka/php-parallel-lint": "^0.9.2",
|
||||||
"phing/phing": "^2.16.0",
|
"phing/phing": "^2.16.0",
|
||||||
|
"phpstan/phpstan": "^0.9",
|
||||||
"phpunit/phpunit": "^6.3",
|
"phpunit/phpunit": "^6.3",
|
||||||
"slevomat/coding-standard": "^3.3.0"
|
"slevomat/coding-standard": "^3.3.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {"PHPStan\\PhpDocParser\\": ["src/"]}
|
"psr-4": {"PHPStan\\PhpDocParser\\": ["src/"]}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {"PHPStan\\PhpDocParser\\": ["tests/PHPStan"]}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,8 @@ class Lexer
|
|||||||
}
|
}
|
||||||
|
|
||||||
preg_match_all($this->regexp, $s, $tokens, PREG_SET_ORDER);
|
preg_match_all($this->regexp, $s, $tokens, PREG_SET_ORDER);
|
||||||
|
|
||||||
|
assert($this->types !== null);
|
||||||
$count = count($this->types);
|
$count = count($this->types);
|
||||||
|
|
||||||
foreach ($tokens as &$match) {
|
foreach ($tokens as &$match) {
|
||||||
|
Loading…
Reference in New Issue
Block a user