Skip to content

Commit

Permalink
Remove RemoveParentRector as never used and only for demo purposes, h…
Browse files Browse the repository at this point in the history
…andle custom way where needed (#4679)
  • Loading branch information
TomasVotruba committed Aug 6, 2023
1 parent a82c863 commit 1eee3a5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 229 deletions.
88 changes: 27 additions & 61 deletions build/target-repository/docs/rector_rules_overview.md
@@ -1,12 +1,12 @@
# 361 Rules Overview
# 360 Rules Overview

<br>

## Categories

- [Arguments](#arguments) (6)

- [CodeQuality](#codequality) (71)
- [CodeQuality](#codequality) (70)

- [CodingStyle](#codingstyle) (30)

Expand Down Expand Up @@ -46,15 +46,15 @@

- [Privatization](#privatization) (4)

- [Removing](#removing) (6)
- [Removing](#removing) (5)

- [Renaming](#renaming) (10)

- [Strict](#strict) (5)

- [Transform](#transform) (22)

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

- [Visibility](#visibility) (3)

Expand Down Expand Up @@ -1072,29 +1072,6 @@ Replace the Double not operator (!!) by type-casting to boolean

<br>

### ReturnTypeFromStrictScalarReturnExprRector

Change return type based on strict scalar returns - string, int, float or bool

- class: [`Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector`](../rules/CodeQuality/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php)

```diff
final class SomeClass
{
- public function run($value)
+ public function run($value): string
{
if ($value) {
return 'yes';
}

return 'no';
}
}
```

<br>

### SetTypeToCastRector

Changes `settype()` to (type) where possible
Expand Down Expand Up @@ -5841,40 +5818,6 @@ return static function (RectorConfig $rectorConfig): void {

<br>

### RemoveParentRector

Removes extends class by name

:wrench: **configure it!**

- class: [`Rector\Removing\Rector\Class_\RemoveParentRector`](../rules/Removing/Rector/Class_/RemoveParentRector.php)

```php
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Removing\Rector\Class_\RemoveParentRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RemoveParentRector::class, [
'SomeParentClass',
]);
};
```


```diff
-final class SomeClass extends SomeParentClass
+final class SomeClass
{
}
```

<br>

### RemoveTraitUseRector

Remove specific traits from code
Expand Down Expand Up @@ -8064,6 +8007,29 @@ Add return type based on strict parameter type

<br>

### ReturnTypeFromStrictScalarReturnExprRector

Change return type based on strict scalar returns - string, int, float or bool

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

```diff
final class SomeClass
{
- public function run($value)
+ public function run($value): string
{
if ($value) {
return 'yes';
}

return 'no';
}
}
```

<br>

### ReturnTypeFromStrictTernaryRector

Add method return type based on strict ternary values
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

95 changes: 0 additions & 95 deletions rules/Removing/Rector/Class_/RemoveParentRector.php

This file was deleted.

0 comments on commit 1eee3a5

Please sign in to comment.