Skip to content

Commit

Permalink
Remove deprecated ArrayShapeFromConstantArrayReturnRector (#4662)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 5, 2023
1 parent 0013604 commit 637d48c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 92 deletions.
23 changes: 1 addition & 22 deletions build/target-repository/docs/rector_rules_overview.md
Expand Up @@ -52,7 +52,7 @@

- [Transform](#transform) (22)

- [TypeDeclaration](#typedeclaration) (45)
- [TypeDeclaration](#typedeclaration) (44)

- [Visibility](#visibility) (3)

Expand Down Expand Up @@ -7640,27 +7640,6 @@ return static function (RectorConfig $rectorConfig): void {

<br>

### ArrayShapeFromConstantArrayReturnRector

Add array shape exact types based on constant keys of array

- class: [`Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector`](../rules/TypeDeclaration/Rector/ClassMethod/ArrayShapeFromConstantArrayReturnRector.php)

```diff
final class SomeClass
{
+ /**
+ * @return array{name: string}
+ */
public function run(string $name)
{
return ['name' => $name];
}
}
```

<br>

### BinaryOpNullableToInstanceofRector

Change && and || between nullable objects to instanceof compares
Expand Down
3 changes: 0 additions & 3 deletions phpstan.neon
Expand Up @@ -659,9 +659,6 @@ parameters:
# submethods that handle smaller change
- '#Method "refactor(.*?)\(\)" returns bool type, so the name should start with is/has/was#'

# deprecated
- '#Fetching class constant class of deprecated class Rector\\TypeDeclaration\\Rector\\ClassMethod\\ArrayShapeFromConstantArrayReturnRector#'

-
message: '#Public method "AutoloadIncluder\:\:.*\(\)" is never used#'
path: bin/rector.php
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions utils/Command/MissingInSetCommand.php
Expand Up @@ -8,7 +8,6 @@
use Rector\CodingStyle\Rector\ClassMethod\DataProviderArrayItemsNewlinedRector;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
use Rector\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector;
use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector;
Expand Down Expand Up @@ -98,8 +97,6 @@ final class MissingInSetCommand extends Command
FlipNegatedTernaryInstanceofRector::class,
BinaryOpNullableToInstanceofRector::class,
WhileNullableToInstanceofRector::class,
// deprecated
ArrayShapeFromConstantArrayReturnRector::class,
];

public function __construct(
Expand Down

0 comments on commit 637d48c

Please sign in to comment.