Skip to content

Commit

Permalink
Remove ForbiddenSameNamedNewInstanceRule as rarely a buggy spot (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 25, 2024
1 parent a23355d commit a9766b3
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 326 deletions.
30 changes: 1 addition & 29 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 42 Rules Overview
# 41 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -470,34 +470,6 @@ final class SomeRector implements RectorInterface

<br>

## ForbiddenSameNamedNewInstanceRule

New objects with "%s" name are overridden. This can lead to unwanted bugs, please pick a different name to avoid it.

- class: [`Symplify\PHPStanRules\Rules\Complexity\ForbiddenSameNamedNewInstanceRule`](../src/Rules/Complexity/ForbiddenSameNamedNewInstanceRule.php)

```php
$product = new Product();
$product = new Product();

$this->productRepository->save($product);
```

:x:

<br>

```php
$firstProduct = new Product();
$secondProduct = new Product();

$this->productRepository->save($firstProduct);
```

:+1:

<br>

## NarrowPublicClassMethodParamTypeByCallerTypeRule

Parameters should use "%s" types as the only types passed to this method
Expand Down
135 changes: 0 additions & 135 deletions src/Rules/Complexity/ForbiddenSameNamedNewInstanceRule.php

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 a9766b3

Please sign in to comment.