-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip changed by ref from trait on TypedPropertyFrom…
…StrictConstructorRector (#6666) * [TypeDeclaration] Skip changed by ref from trait on TypedPropertyFromStrictConstructorRector * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
d347dd3
commit 9d81eba
Showing
6 changed files
with
50 additions
and
22 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...erty/TypedPropertyFromStrictConstructorRector/Fixture/skip_by_ref_assign_on_trait.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture; | ||
|
||
use Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source\ByRefTrait; | ||
|
||
final class SkipByRefAssignOnTrait | ||
{ | ||
use ByRefTrait; | ||
|
||
private $str; | ||
|
||
public function __construct(string $str) | ||
{ | ||
$this->str = $str; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...eclaration/Rector/Property/TypedPropertyFromStrictConstructorRector/Source/ByRefTrait.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,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source; | ||
|
||
trait ByRefTrait | ||
{ | ||
public function run() | ||
{ | ||
$str = &$this->str; | ||
$str = null; | ||
} | ||
} |
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