-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip pull property from inner class on CompleteDynamicP…
…ropertiesRector (#4561) * [CodeQuality] Skip pull property from inner class on CompleteDynamicPropertiesRector * Fix * clean up * clean up * clean up * skip pull from differnt class
- Loading branch information
1 parent
ef6aa9e
commit 1411c04
Showing
4 changed files
with
47 additions
and
4 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
20 changes: 20 additions & 0 deletions
20
...odeQuality/Rector/Class_/CompleteDynamicPropertiesRector/Fixture/skip_inner_class.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,20 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector\Fixture; | ||
|
||
final class SkipInnerClass | ||
{ | ||
public function run() | ||
{ | ||
$box = new class () { | ||
public $logged; | ||
|
||
public function hold(string $value) | ||
{ | ||
$this->logged = $value; | ||
} | ||
}; | ||
|
||
echo $box->logged; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...tor/Class_/CompleteDynamicPropertiesRector/Fixture/skip_pull_from_different_class.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector\Source\DifferentClass; | ||
|
||
class SkipPullFromDifferentClass | ||
{ | ||
public function run() | ||
{ | ||
$obj = new DifferentClass(); | ||
echo $obj->property; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...tests/CodeQuality/Rector/Class_/CompleteDynamicPropertiesRector/Source/DifferentClass.php
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector\Source; | ||
|
||
class DifferentClass | ||
{ | ||
public $property = 'some value'; | ||
} |