Skip to content

Commit

Permalink
Remove SwitchToMatchSpotterRule as depends on context (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba authored Aug 22, 2023
1 parent 5528cee commit a63b8fe
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 261 deletions.
35 changes: 1 addition & 34 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 60 Rules Overview
# 59 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -2182,39 +2182,6 @@ class SomeClass extends Rule

<br>

## SwitchToMatchSpotterRule

Switch construction can be replace with more robust `match()`

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

```php
switch ($key) {
case 1:
return 100;
case 2:
return 200;
default:
return 300;
};
```

:x:

<br>

```php
return match($key) {
1 => 100,
2 => 200,
default => 300,
};
```

:+1:

<br>

## TwigPublicCallableExistsRule

The callable method [$this, "%s"] was not found
Expand Down
123 changes: 0 additions & 123 deletions src/Rules/Spotter/SwitchToMatchSpotterRule.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.

0 comments on commit a63b8fe

Please sign in to comment.