Skip to content

Commit

Permalink
Require PHPStan 1.11 (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored May 14, 2024
1 parent 24be5e2 commit c1619ed
Show file tree
Hide file tree
Showing 43 changed files with 131 additions and 121 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "^1.10.51"
"phpstan/phpstan": "^1.11.0"
},
"require-dev": {
"editorconfig-checker/editorconfig-checker": "^10.6.0",
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.

4 changes: 2 additions & 2 deletions src/Rule/AllowComparingOnlyComparableTypesRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use PhpParser\Node\Expr\BinaryOp\SmallerOrEqual;
use PhpParser\Node\Expr\BinaryOp\Spaceship;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\FloatType;
use PHPStan\Type\IntegerType;
Expand All @@ -36,7 +36,7 @@ public function getNodeType(): string

/**
* @param BinaryOp $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/AllowNamedArgumentOnlyInAttributesRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use PhpParser\Node;
use PhpParser\Node\Arg;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use ShipMonk\PHPStan\Visitor\NamedArgumentSourceVisitor;

Expand All @@ -23,7 +23,7 @@ public function getNodeType(): string

/**
* @param Arg $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/BackedEnumGenericsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PHPStan\Analyser\Scope;
use PHPStan\Node\InClassNode;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\VerbosityLevel;

Expand All @@ -25,7 +25,7 @@ public function getNodeType(): string

/**
* @param InClassNode $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/ClassSuffixNamingRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Node\InClassNode;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use function strlen;
use function substr_compare;
Expand Down Expand Up @@ -37,7 +37,7 @@ public function getNodeType(): string

/**
* @param InClassNode $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(
Node $node,
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceClosureParamNativeTypehintRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use PHPStan\Node\InArrowFunctionNode;
use PHPStan\Node\InClosureNode;
use PHPStan\Php\PhpVersion;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\MixedType;
use function is_string;
Expand Down Expand Up @@ -39,7 +39,7 @@ public function getNodeType(): string
}

/**
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(
Node $node,
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceEnumMatchRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\Enum\EnumCaseObjectType;
use function array_map;
Expand All @@ -29,7 +29,7 @@ public function getNodeType(): string

/**
* @param BinaryOp $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceIteratorToArrayPreserveKeysRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use function count;

Expand All @@ -24,7 +24,7 @@ public function getNodeType(): string

/**
* @param FuncCall $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceListReturnRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\Accessory\AccessoryArrayListType;
use PHPStan\Type\VerbosityLevel;
Expand All @@ -29,7 +29,7 @@ public function getNodeType(): string

/**
* @param ReturnStatementsNode $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceNativeReturnTypehintRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use PHPStan\Analyser\Scope;
use PHPStan\Node\ReturnStatementsNode;
use PHPStan\Php\PhpVersion;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
Expand Down Expand Up @@ -64,7 +64,7 @@ public function getNodeType(): string

/**
* @param ReturnStatementsNode $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/EnforceReadonlyPublicPropertyRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use PHPStan\Analyser\Scope;
use PHPStan\Node\ClassPropertyNode;
use PHPStan\Php\PhpVersion;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;

/**
Expand All @@ -30,7 +30,7 @@ public function getNodeType(): string

/**
* @param ClassPropertyNode $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
10 changes: 5 additions & 5 deletions src/Rule/ForbidArithmeticOperationOnNonNumberRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use PhpParser\Node\Expr\UnaryMinus;
use PhpParser\Node\Expr\UnaryPlus;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\FloatType;
use PHPStan\Type\IntegerType;
Expand Down Expand Up @@ -42,7 +42,7 @@ public function getNodeType(): string
}

/**
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand All @@ -68,7 +68,7 @@ public function processNode(Node $node, Scope $scope): array
}

/**
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
private function processUnary(Expr $expr, Scope $scope, string $operator): array
{
Expand All @@ -90,7 +90,7 @@ private function processUnary(Expr $expr, Scope $scope, string $operator): array
}

/**
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
private function processBinary(Expr $left, Expr $right, Scope $scope, string $operator): array
{
Expand Down Expand Up @@ -128,7 +128,7 @@ private function isNumeric(Type $type): bool
}

/**
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
private function buildBinaryErrors(string $operator, string $type, Type $leftType, Type $rightType): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/ForbidAssignmentNotMatchingVarDocRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PhpParser\Node\Expr\Variable;
use PHPStan\Analyser\Scope;
use PHPStan\PhpDoc\Tag\VarTag;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ArrayType;
use PHPStan\Type\FileTypeMapper;
Expand Down Expand Up @@ -46,7 +46,7 @@ public function getNodeType(): string

/**
* @param Assign $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Rule/ForbidCastRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use PhpParser\Node\Expr\Cast\String_;
use PhpParser\Node\Expr\Cast\Unset_;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use function get_class;
use function in_array;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function getNodeType(): string

/**
* @param Cast $node
* @return list<RuleError>
* @return list<IdentifierRuleError>
*/
public function processNode(Node $node, Scope $scope): array
{
Expand Down
Loading

0 comments on commit c1619ed

Please sign in to comment.