Merge pull request #517 from simPod/upgrade-phpstan

Upgrade PHPStan to 0.11.12
This commit is contained in:
Vladimir Razuvaev 2019-07-12 16:35:34 +07:00 committed by GitHub
commit a01b089058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -16,7 +16,7 @@
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^6.0", "doctrine/coding-standard": "^6.0",
"phpbench/phpbench": "^0.14.0", "phpbench/phpbench": "^0.14.0",
"phpstan/phpstan": "^0.11.8", "phpstan/phpstan": "^0.11.12",
"phpstan/phpstan-phpunit": "^0.11.2", "phpstan/phpstan-phpunit": "^0.11.2",
"phpstan/phpstan-strict-rules": "^0.11.1", "phpstan/phpstan-strict-rules": "^0.11.1",
"phpunit/phpcov": "^5.0", "phpunit/phpcov": "^5.0",

View File

@ -159,9 +159,10 @@ class BuildSchema
// If specified directives were not explicitly declared, add them. // If specified directives were not explicitly declared, add them.
$skip = array_reduce( $skip = array_reduce(
$directives, $directives,
static function ($hasSkip, $directive) { static function (bool $hasSkip, Directive $directive) : bool {
return $hasSkip || $directive->name === 'skip'; return $hasSkip || $directive->name === 'skip';
} },
false
); );
if (! $skip) { if (! $skip) {
$directives[] = Directive::skipDirective(); $directives[] = Directive::skipDirective();
@ -169,9 +170,10 @@ class BuildSchema
$include = array_reduce( $include = array_reduce(
$directives, $directives,
static function ($hasInclude, $directive) { static function (bool $hasInclude, Directive $directive) : bool {
return $hasInclude || $directive->name === 'include'; return $hasInclude || $directive->name === 'include';
} },
false
); );
if (! $include) { if (! $include) {
$directives[] = Directive::includeDirective(); $directives[] = Directive::includeDirective();
@ -179,9 +181,10 @@ class BuildSchema
$deprecated = array_reduce( $deprecated = array_reduce(
$directives, $directives,
static function ($hasDeprecated, $directive) { static function (bool $hasDeprecated, Directive $directive) : bool {
return $hasDeprecated || $directive->name === 'deprecated'; return $hasDeprecated || $directive->name === 'deprecated';
} },
false
); );
if (! $deprecated) { if (! $deprecated) {
$directives[] = Directive::deprecatedDirective(); $directives[] = Directive::deprecatedDirective();