-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[e2e] Add e2e for tests removed node display applied rules with retur…
…n null (#2320) * [e2e] Add e2e for tests removed node display applied rules with return null * update
- Loading branch information
1 parent
91ffbbb
commit c0086b7
Showing
8 changed files
with
86 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"require": { | ||
"php": "^8.1" | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
2 files with changes | ||
==================== | ||
|
||
1) src/DeadConstructor.php:1 | ||
|
||
---------- begin diff ---------- | ||
@@ @@ | ||
|
||
final class DeadConstructor | ||
{ | ||
- public function __construct() | ||
- { | ||
- } | ||
} | ||
----------- end diff ----------- | ||
|
||
Applied rules: | ||
* RemoveDeadConstructorRector | ||
|
||
|
||
2) src/AlwaysTrue.php:3 | ||
|
||
---------- begin diff ---------- | ||
@@ @@ | ||
{ | ||
public function run() | ||
{ | ||
- if (1 === 1) { | ||
- } | ||
- | ||
return 'no'; | ||
} | ||
} | ||
----------- end diff ----------- | ||
|
||
Applied rules: | ||
* RemoveAlwaysTrueIfConditionRector | ||
|
||
|
||
[OK] 2 files would have changed (dry-run) by Rector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector; | ||
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/src', | ||
]); | ||
|
||
$rectorConfig->rule(RemoveDeadConstructorRector::class); | ||
$rectorConfig->rule(RemoveAlwaysTrueIfConditionRector::class); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
final class AlwaysTrue | ||
{ | ||
public function run() | ||
{ | ||
if (1 === 1) { | ||
} | ||
|
||
return 'no'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
final class DeadConstructor | ||
{ | ||
public function __construct() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters