Skip to content

Commit

Permalink
Bump symplify/phpstan-rules from 12.6.4 to 12.7.0 (#717)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Markus Staab <[email protected]>
  • Loading branch information
dependabot[bot] and staabm authored May 31, 2024
1 parent eb033f3 commit 5c2b5cf
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 486 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"staabm/phpstan-baseline-analysis": "0.12.5",
"staabm/phpstan-dba": "0.2.80",
"staabm/phpstan-todo-by": "0.1.27",
"symplify/phpstan-rules": "12.6.4",
"symplify/phpstan-rules": "12.7.0",
"thecodingmachine/phpstan-safe-rule": "1.2",
"thecodingmachine/safe": "1.3.3",
"tomasvotruba/cognitive-complexity": "0.2.3",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

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

3 changes: 0 additions & 3 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,6 @@
'Symplify\\PHPStanRules\\Rules\\CheckTypehintCallerTypeRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/CheckTypehintCallerTypeRule.php',
'Symplify\\PHPStanRules\\Rules\\ClassNameRespectsParentSuffixRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/ClassNameRespectsParentSuffixRule.php',
'Symplify\\PHPStanRules\\Rules\\Complexity\\ForbiddenArrayMethodCallRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/Complexity/ForbiddenArrayMethodCallRule.php',
'Symplify\\PHPStanRules\\Rules\\Complexity\\ForbiddenSameNamedNewInstanceRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/Complexity/ForbiddenSameNamedNewInstanceRule.php',
'Symplify\\PHPStanRules\\Rules\\Domain\\RequireAttributeNamespaceRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/Domain/RequireAttributeNamespaceRule.php',
'Symplify\\PHPStanRules\\Rules\\Domain\\RequireExceptionNamespaceRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/Domain/RequireExceptionNamespaceRule.php',
'Symplify\\PHPStanRules\\Rules\\Enum\\RequireUniqueEnumConstantRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/Enum/RequireUniqueEnumConstantRule.php',
Expand All @@ -1619,15 +1618,13 @@
'Symplify\\PHPStanRules\\Rules\\NoArrayAccessOnObjectRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoArrayAccessOnObjectRule.php',
'Symplify\\PHPStanRules\\Rules\\NoDuplicatedShortClassNameRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoDuplicatedShortClassNameRule.php',
'Symplify\\PHPStanRules\\Rules\\NoDynamicNameRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoDynamicNameRule.php',
'Symplify\\PHPStanRules\\Rules\\NoEmptyClassRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoEmptyClassRule.php',
'Symplify\\PHPStanRules\\Rules\\NoInlineStringRegexRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoInlineStringRegexRule.php',
'Symplify\\PHPStanRules\\Rules\\NoIssetOnObjectRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoIssetOnObjectRule.php',
'Symplify\\PHPStanRules\\Rules\\NoMissingDirPathRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoMissingDirPathRule.php',
'Symplify\\PHPStanRules\\Rules\\NoNullableArrayPropertyRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoNullableArrayPropertyRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReferenceRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoReferenceRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReturnArrayVariableListRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoReturnArrayVariableListRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReturnSetterMethodRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoReturnSetterMethodRule.php',
'Symplify\\PHPStanRules\\Rules\\NoVoidGetterMethodRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/NoVoidGetterMethodRule.php',
'Symplify\\PHPStanRules\\Rules\\PHPUnit\\NoTestMocksRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/PHPUnit/NoTestMocksRule.php',
'Symplify\\PHPStanRules\\Rules\\PreferredClassRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/PreferredClassRule.php',
'Symplify\\PHPStanRules\\Rules\\PreventParentMethodVisibilityOverrideRule' => $vendorDir . '/symplify/phpstan-rules/src/Rules/PreventParentMethodVisibilityOverrideRule.php',
Expand Down
3 changes: 0 additions & 3 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,6 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f
'Symplify\\PHPStanRules\\Rules\\CheckTypehintCallerTypeRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/CheckTypehintCallerTypeRule.php',
'Symplify\\PHPStanRules\\Rules\\ClassNameRespectsParentSuffixRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/ClassNameRespectsParentSuffixRule.php',
'Symplify\\PHPStanRules\\Rules\\Complexity\\ForbiddenArrayMethodCallRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/Complexity/ForbiddenArrayMethodCallRule.php',
'Symplify\\PHPStanRules\\Rules\\Complexity\\ForbiddenSameNamedNewInstanceRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/Complexity/ForbiddenSameNamedNewInstanceRule.php',
'Symplify\\PHPStanRules\\Rules\\Domain\\RequireAttributeNamespaceRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/Domain/RequireAttributeNamespaceRule.php',
'Symplify\\PHPStanRules\\Rules\\Domain\\RequireExceptionNamespaceRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/Domain/RequireExceptionNamespaceRule.php',
'Symplify\\PHPStanRules\\Rules\\Enum\\RequireUniqueEnumConstantRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/Enum/RequireUniqueEnumConstantRule.php',
Expand All @@ -1833,15 +1832,13 @@ class ComposerStaticInit9cf8af24a7a084f114b4553be2a1ff9f
'Symplify\\PHPStanRules\\Rules\\NoArrayAccessOnObjectRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoArrayAccessOnObjectRule.php',
'Symplify\\PHPStanRules\\Rules\\NoDuplicatedShortClassNameRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoDuplicatedShortClassNameRule.php',
'Symplify\\PHPStanRules\\Rules\\NoDynamicNameRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoDynamicNameRule.php',
'Symplify\\PHPStanRules\\Rules\\NoEmptyClassRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoEmptyClassRule.php',
'Symplify\\PHPStanRules\\Rules\\NoInlineStringRegexRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoInlineStringRegexRule.php',
'Symplify\\PHPStanRules\\Rules\\NoIssetOnObjectRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoIssetOnObjectRule.php',
'Symplify\\PHPStanRules\\Rules\\NoMissingDirPathRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoMissingDirPathRule.php',
'Symplify\\PHPStanRules\\Rules\\NoNullableArrayPropertyRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoNullableArrayPropertyRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReferenceRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoReferenceRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReturnArrayVariableListRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoReturnArrayVariableListRule.php',
'Symplify\\PHPStanRules\\Rules\\NoReturnSetterMethodRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoReturnSetterMethodRule.php',
'Symplify\\PHPStanRules\\Rules\\NoVoidGetterMethodRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/NoVoidGetterMethodRule.php',
'Symplify\\PHPStanRules\\Rules\\PHPUnit\\NoTestMocksRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/PHPUnit/NoTestMocksRule.php',
'Symplify\\PHPStanRules\\Rules\\PreferredClassRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/PreferredClassRule.php',
'Symplify\\PHPStanRules\\Rules\\PreventParentMethodVisibilityOverrideRule' => __DIR__ . '/..' . '/symplify/phpstan-rules/src/Rules/PreventParentMethodVisibilityOverrideRule.php',
Expand Down
42 changes: 21 additions & 21 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -887,17 +887,17 @@
},
{
"name": "phpstan/phpstan-symfony",
"version": "1.4.1",
"version_normalized": "1.4.1.0",
"version": "1.4.3",
"version_normalized": "1.4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-symfony.git",
"reference": "d530cfebba55763732bc2421f79d2576d9d7942f"
"reference": "af6ae0f4b91bc080265e80776af26da3e5befb28"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/d530cfebba55763732bc2421f79d2576d9d7942f",
"reference": "d530cfebba55763732bc2421f79d2576d9d7942f",
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/af6ae0f4b91bc080265e80776af26da3e5befb28",
"reference": "af6ae0f4b91bc080265e80776af26da3e5befb28",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -926,7 +926,7 @@
"symfony/serializer": "^5.4",
"symfony/service-contracts": "^2.2.0"
},
"time": "2024-05-24T14:00:29+00:00",
"time": "2024-05-30T15:01:27+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
Expand Down Expand Up @@ -956,7 +956,7 @@
"description": "Symfony Framework extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-symfony/issues",
"source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.1"
"source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.3"
},
"install-path": "../phpstan/phpstan-symfony"
},
Expand Down Expand Up @@ -1231,17 +1231,17 @@
},
{
"name": "staabm/phpstan-todo-by",
"version": "0.1.26",
"version_normalized": "0.1.26.0",
"version": "0.1.27",
"version_normalized": "0.1.27.0",
"source": {
"type": "git",
"url": "https://github.com/staabm/phpstan-todo-by.git",
"reference": "0a9f996582fbec5816bc4f0f3e11c4aa94a5fd6c"
"reference": "aef25bd71ce63de28acb1c82289cb5bff172fcff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/0a9f996582fbec5816bc4f0f3e11c4aa94a5fd6c",
"reference": "0a9f996582fbec5816bc4f0f3e11c4aa94a5fd6c",
"url": "https://api.github.com/repos/staabm/phpstan-todo-by/zipball/aef25bd71ce63de28acb1c82289cb5bff172fcff",
"reference": "aef25bd71ce63de28acb1c82289cb5bff172fcff",
"shasum": ""
},
"require": {
Expand All @@ -1259,7 +1259,7 @@
"phpunit/phpunit": "^9 || ^10.5",
"redaxo/php-cs-fixer-config": "^1.0"
},
"time": "2024-05-24T15:09:38+00:00",
"time": "2024-05-24T17:49:10+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
Expand Down Expand Up @@ -1288,7 +1288,7 @@
],
"support": {
"issues": "https://github.com/staabm/phpstan-todo-by/issues",
"source": "https://github.com/staabm/phpstan-todo-by/tree/0.1.26"
"source": "https://github.com/staabm/phpstan-todo-by/tree/0.1.27"
},
"funding": [
{
Expand Down Expand Up @@ -1383,17 +1383,17 @@
},
{
"name": "symplify/phpstan-rules",
"version": "12.6.4",
"version_normalized": "12.6.4.0",
"version": "12.7.0",
"version_normalized": "12.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/symplify/phpstan-rules.git",
"reference": "8485673fb551c27fdb443d0d34e95ba4d0b3afbe"
"reference": "14f506143ae7d6548da88326331cc536686e224f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symplify/phpstan-rules/zipball/8485673fb551c27fdb443d0d34e95ba4d0b3afbe",
"reference": "8485673fb551c27fdb443d0d34e95ba4d0b3afbe",
"url": "https://api.github.com/repos/symplify/phpstan-rules/zipball/14f506143ae7d6548da88326331cc536686e224f",
"reference": "14f506143ae7d6548da88326331cc536686e224f",
"shasum": ""
},
"require": {
Expand All @@ -1402,7 +1402,7 @@
"phpstan/phpstan": "^1.10.30",
"webmozart/assert": "^1.11"
},
"time": "2024-05-21T09:44:11+00:00",
"time": "2024-05-25T15:32:40+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
Expand All @@ -1424,7 +1424,7 @@
"description": "Set of Symplify rules for PHPStan",
"support": {
"issues": "https://github.com/symplify/phpstan-rules/issues",
"source": "https://github.com/symplify/phpstan-rules/tree/12.6.4"
"source": "https://github.com/symplify/phpstan-rules/tree/12.7.0"
},
"funding": [
{
Expand Down
22 changes: 11 additions & 11 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'd23723d8def1ad4473333a37569bbf4a3f0443d1',
'reference' => '0ec3c35bb548592a2fbb99172a6d5d42a0aa80e5',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'd23723d8def1ad4473333a37569bbf4a3f0443d1',
'reference' => '0ec3c35bb548592a2fbb99172a6d5d42a0aa80e5',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -149,9 +149,9 @@
'dev_requirement' => false,
),
'phpstan/phpstan-symfony' => array(
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
'reference' => 'd530cfebba55763732bc2421f79d2576d9d7942f',
'pretty_version' => '1.4.3',
'version' => '1.4.3.0',
'reference' => 'af6ae0f4b91bc080265e80776af26da3e5befb28',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../phpstan/phpstan-symfony',
'aliases' => array(),
Expand Down Expand Up @@ -194,9 +194,9 @@
'dev_requirement' => false,
),
'staabm/phpstan-todo-by' => array(
'pretty_version' => '0.1.26',
'version' => '0.1.26.0',
'reference' => '0a9f996582fbec5816bc4f0f3e11c4aa94a5fd6c',
'pretty_version' => '0.1.27',
'version' => '0.1.27.0',
'reference' => 'aef25bd71ce63de28acb1c82289cb5bff172fcff',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../staabm/phpstan-todo-by',
'aliases' => array(),
Expand All @@ -212,9 +212,9 @@
'dev_requirement' => false,
),
'symplify/phpstan-rules' => array(
'pretty_version' => '12.6.4',
'version' => '12.6.4.0',
'reference' => '8485673fb551c27fdb443d0d34e95ba4d0b3afbe',
'pretty_version' => '12.7.0',
'version' => '12.7.0.0',
'reference' => '14f506143ae7d6548da88326331cc536686e224f',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../symplify/phpstan-rules',
'aliases' => array(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public function create(): ServiceMap
}

$service = new Service(
strpos((string) $attrs->id, '.') === 0 ? substr((string) $attrs->id, 1) : (string) $attrs->id,
$this->cleanServiceId((string) $attrs->id),
isset($attrs->class) ? (string) $attrs->class : null,
isset($attrs->public) && (string) $attrs->public === 'true',
isset($attrs->synthetic) && (string) $attrs->synthetic === 'true',
isset($attrs->alias) ? (string) $attrs->alias : null
isset($attrs->alias) ? $this->cleanServiceId((string) $attrs->alias) : null
);

if ($service->getAlias() !== null) {
Expand All @@ -79,4 +79,9 @@ public function create(): ServiceMap
return new DefaultServiceMap($services);
}

private function cleanServiceId(string $id): string
{
return strpos($id, '.') === 0 ? substr($id, 1) : $id;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
use PHPStan\Type\ArrayType;
use PHPStan\Type\DynamicMethodReturnTypeExtension;
use PHPStan\Type\IntegerType;
use PHPStan\Type\NullType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\TypeUtils;
use function count;
use function in_array;

final class InputInterfaceGetArgumentDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{
Expand Down Expand Up @@ -76,6 +78,15 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
}
}

$method = $scope->getFunction();
if (
$method instanceof MethodReflection
&& $method->getName() === 'interact'
&& in_array('Symfony\Component\Console\Command\Command', $method->getDeclaringClass()->getParentClassesNames(), true)
) {
$argTypes[] = new NullType();
}

return count($argTypes) > 0 ? TypeCombinator::union(...$argTypes) : null;
}

Expand Down
Loading

0 comments on commit 5c2b5cf

Please sign in to comment.