Skip to content

Commit

Permalink
Revert adding RemoveNamespaceRector (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Apr 23, 2022
1 parent cd3f45d commit 2f5a525
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 436 deletions.
62 changes: 33 additions & 29 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

- [DependencyInjection](#dependencyinjection) (2)

- [DogFood](#dogfood) (1)

- [DowngradePhp53](#downgradephp53) (1)

- [DowngradePhp54](#downgradephp54) (7)
Expand Down Expand Up @@ -76,7 +78,7 @@

- [Privatization](#privatization) (10)

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

- [RemovingStatic](#removingstatic) (1)

Expand Down Expand Up @@ -3752,6 +3754,36 @@ return static function (RectorConfig $rectorConfig): void {

<br>

## DogFood

### UpgradeRectorConfigRector

Upgrade rector.php config to use of RectorConfig

- class: [`Rector\DogFood\Rector\Closure\UpgradeRectorConfigRector`](../rules/DogFood/Rector/Closure/UpgradeRectorConfigRector.php)

```diff
-use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\Property\TypedPropertyRector;
-use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
+use Rector\Config\RectorConfig;

-return static function (ContainerConfigurator $containerConfigurator): void {
- $parameters = $containerConfigurator->parameters();
- $parameters->set(Option::PARALLEL, true);
- $parameters->set(Option::AUTO_IMPORT_NAMES, true);
+return static function (RectorConfig $rectorConfig): void {
+ $rectorConfig->parallel();
+ $rectorConfig->importNames();

- $services = $containerConfigurator->services();
- $services->set(TypedPropertyRector::class);
+ $rectorConfig->rule(TypedPropertyRector::class);
};
```

<br>

## DowngradePhp53

### DirConstToFileConstRector
Expand Down Expand Up @@ -9075,34 +9107,6 @@ return static function (RectorConfig $rectorConfig): void {

<br>

### RemoveNamespaceRector

Remove namespace by configured namespace names

:wrench: **configure it!**

- class: [`Rector\Removing\Rector\Namespace_\RemoveNamespaceRector`](../rules/Removing/Rector/Namespace_/RemoveNamespaceRector.php)

```php
use Rector\Config\RectorConfig;
use Rector\Removing\Rector\Namespace_\RemoveNamespaceRector;

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


```diff
-namespace App;
class SomeClass
{
}
```

<br>

### RemoveParentRector

Removes extends class by name
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2f5a525

Please sign in to comment.