Skip to content

Commit

Permalink
Merge pull request #55 from CPS-IT/feature/phpstan-type-coverage
Browse files Browse the repository at this point in the history
[FEATURE] Measure type coverage within PHPStan
  • Loading branch information
eliashaeussler committed Dec 8, 2022
2 parents c871a66 + ef8fc5a commit 45693c3
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5.5",
"rector/rector": "^0.14.8",
"seld/jsonlint": "^1.9"
"seld/jsonlint": "^1.9",
"symplify/phpstan-rules": "^11.1"
},
"autoload": {
"psr-4": {
Expand Down
195 changes: 194 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- .build/vendor/phpstan/phpstan/conf/bleedingEdge.neon

parameters:
level: max
paths:
Expand All @@ -11,3 +12,29 @@ parameters:
- tests/bootstrap.php
symfony:
containerXmlPath: var/cache/test-container.xml

services:
-
class: Symplify\PHPStanRules\Rules\Explicit\PropertyTypeDeclarationSeaLevelRule
tags: [phpstan.rules.rule]
arguments:
minimalLevel: 0.99
-
class: Symplify\PHPStanRules\Rules\Explicit\ParamTypeDeclarationSeaLevelRule
tags: [phpstan.rules.rule]
arguments:
minimalLevel: 0.99
-
class: Symplify\PHPStanRules\Rules\Explicit\ReturnTypeDeclarationSeaLevelRule
tags: [phpstan.rules.rule]
arguments:
minimalLevel: 0.99
-
class: Symplify\PHPStanRules\Collector\FunctionLike\ParamTypeSeaLevelCollector
tags: [phpstan.collector]
-
class: Symplify\PHPStanRules\Collector\FunctionLike\ReturnTypeSeaLevelCollector
tags: [phpstan.collector]
-
class: Symplify\PHPStanRules\Collector\ClassLike\PropertyTypeSeaLevelCollector
tags: [phpstan.collector]
2 changes: 1 addition & 1 deletion src/IO/InputReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function choices(
*
* @return TYes|TNo
*/
public function ask(string $question, $yesValue = true, $noValue = false, bool $default = true)
public function ask(string $question, mixed $yesValue = true, mixed $noValue = false, bool $default = true): mixed
{
$label = Messenger::decorateLabel($question, $default ? 'Y' : 'N', true, [$default ? 'n' : 'y']);

Expand Down

0 comments on commit 45693c3

Please sign in to comment.