Skip to content

Commit

Permalink
Remove ReservedObjectRector as requires explicit configuration and is…
Browse files Browse the repository at this point in the history
… handled by RenameClassRector already (#3975)
  • Loading branch information
TomasVotruba committed May 26, 2023
1 parent 6d4a73e commit c1cb710
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 293 deletions.
55 changes: 3 additions & 52 deletions build/target-repository/docs/rector_rules_overview.md
@@ -1,4 +1,4 @@
# 398 Rules Overview
# 396 Rules Overview

<br>

Expand Down Expand Up @@ -36,9 +36,9 @@

- [Php70](#php70) (19)

- [Php71](#php71) (9)
- [Php71](#php71) (8)

- [Php72](#php72) (10)
- [Php72](#php72) (9)

- [Php73](#php73) (9)

Expand Down Expand Up @@ -4944,41 +4944,6 @@ Remove extra parameters

<br>

### ReservedObjectRector

Changes reserved "Object" name to "<Smart>Object" where <Smart> can be configured

:wrench: **configure it!**

- class: [`Rector\Php71\Rector\Name\ReservedObjectRector`](../rules/Php71/Rector/Name/ReservedObjectRector.php)

```php
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php71\Rector\Name\ReservedObjectRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(ReservedObjectRector::class, [
'ReservedObject' => 'SmartObject',
'Object' => 'AnotherSmartObject',
]);
};
```


```diff
-class Object
+class SmartObject
{
}
```

<br>

## Php72

### CreateFunctionToAnonymousFunctionRector
Expand Down Expand Up @@ -5022,20 +4987,6 @@ Null is no more allowed in `get_class()`

<br>

### IsObjectOnIncompleteClassRector

Incomplete class returns inverted bool on `is_object()`

- class: [`Rector\Php72\Rector\FuncCall\IsObjectOnIncompleteClassRector`](../rules/Php72/Rector/FuncCall/IsObjectOnIncompleteClassRector.php)

```diff
$incompleteObject = new __PHP_Incomplete_Class;
-$isObject = is_object($incompleteObject);
+$isObject = ! is_object($incompleteObject);
```

<br>

### ListEachRector

`each()` function is deprecated, use `key()` and `current()` instead
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

130 changes: 0 additions & 130 deletions rules/Php71/Rector/Name/ReservedObjectRector.php

This file was deleted.

0 comments on commit c1cb710

Please sign in to comment.