-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Merge attributes on NewInInitializerRector (#3546)
* Add failing test fixture for NewInInitializerRector # Failing Test for NewInInitializerRector Based on https://getrector.com/demo/dd5bff80-0789-4aae-b2a3-686c23a3d164 * Update property_with_attributes.php.inc * Closes #3516 --------- Co-authored-by: Leo Viezens <leo.viezens@web.de>
- Loading branch information
1 parent
8aa976c
commit e145ef2
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
.../Php81/Rector/ClassMethod/NewInInitializerRector/Fixture/property_with_attributes.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,41 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassMethod\NewInInitializerRector\Fixture; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Symfony\Component\Uid\Ulid; | ||
|
||
#[ORM\Entity] | ||
class Carrier | ||
{ | ||
#[ORM\Id] | ||
#[ORM\Column(type: 'ulid', unique: true)] | ||
private Ulid $id; | ||
|
||
public function __construct( | ||
?Ulid $id = null, | ||
) { | ||
$this->id = $id ?? new Ulid(); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\ClassMethod\NewInInitializerRector\Fixture; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Symfony\Component\Uid\Ulid; | ||
|
||
#[ORM\Entity] | ||
class Carrier | ||
{ | ||
public function __construct(#[ORM\Id] | ||
#[ORM\Column(type: 'ulid', unique: true)] | ||
private Ulid $id = new Ulid()) | ||
{ | ||
} | ||
} | ||
|
||
?> |
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