Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php56] Skip already initialized on next Stmt on AddDefaultValueForUn…
…definedVariableRector (#2721) * [Php56] Skip already initialized on next Stmt on AddDefaultValueForUndefinedVariableRector * Fixed 🎉 * [ci-review] Rector Rectify * clean up * phpstan Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
ec291c4
commit 7ca5096
Showing
104 changed files
with
177 additions
and
130 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
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
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 |
---|---|---|
|
@@ -103,7 +103,7 @@ public function run($value) | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -65,7 +65,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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
23 changes: 23 additions & 0 deletions
23
...e/AddDefaultValueForUndefinedVariableRector/Fixture/skip_already_initialized_next.php.inc
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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector\Fixture; | ||
|
||
class SkipAlreadyInitializedNext | ||
{ | ||
public function run() | ||
{ | ||
$a = null; | ||
$b = null; | ||
|
||
if (rand(0, 1)) { | ||
$a = 5; | ||
$b = 2; | ||
} else if (rand(0,1)) { | ||
unset($a); | ||
unset($b); | ||
} | ||
|
||
echo $a; | ||
echo $b; | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ public function run(): void | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
final class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ public function run($items) | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ public function go() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -34,7 +34,7 @@ public function run($value) | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ public function run(): void | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ public function run($values, $keyToMatch) | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -117,7 +117,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
[ | ||
self::DELIMITER => '#', | ||
] | ||
|
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 |
---|---|---|
|
@@ -39,7 +39,7 @@ class SomeClass | |
private $isDisabled; | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -62,7 +62,7 @@ final class SomeClass | |
private ?array $dateTimes; | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
['var', 'phpstan-var'], | ||
), | ||
] | ||
|
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 |
---|---|---|
|
@@ -30,7 +30,7 @@ class SomeClass | |
use SomeTrait, AnotherTrait; | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
use A; | ||
use B; | ||
|
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 |
---|---|---|
|
@@ -58,7 +58,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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
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 |
---|---|---|
|
@@ -63,7 +63,7 @@ public function run($value) | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -51,7 +51,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -63,7 +63,7 @@ class SomeClass | |
{ | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
[ | ||
self::REMOVE_ASSIGN_SIDE_EFFECT => 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 |
---|---|---|
|
@@ -35,7 +35,7 @@ private function getBool(): bool | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -37,7 +37,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
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 |
---|---|---|
|
@@ -50,7 +50,7 @@ public function run() | |
} | ||
} | ||
CODE_SAMPLE | ||
, | ||
, | ||
<<<'CODE_SAMPLE' | ||
class SomeClass | ||
{ | ||
|
Oops, something went wrong.