-
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sub namespace Groups fixture on AnnotationToAttributeRector
- Loading branch information
1 parent
69c2201
commit 96cb007
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
.../Rector/Class_/AnnotationToAttributeRector/Fixture/Symfony/same_groups_class_name.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,48 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source; | ||
|
||
use Symfony\Component\Serializer\Attribute\Groups; | ||
|
||
class Booking | ||
{ | ||
/** | ||
* @var int | ||
* | ||
* @Groups({"Booking.id"}) | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var int | ||
* | ||
* @Source\Groups({"Booking.id"}) | ||
*/ | ||
private $id2; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source; | ||
|
||
use Symfony\Component\Serializer\Attribute\Groups; | ||
|
||
class Booking | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
#[Groups(['Booking.id'])] | ||
private $id; | ||
|
||
/** | ||
* @var int | ||
* | ||
* @Source\Groups({"Booking.id"}) | ||
*/ | ||
private $id2; | ||
} | ||
|
||
?> |
13 changes: 13 additions & 0 deletions
13
rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Groups.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\Php80\Rector\Class_\AnnotationToAttributeRector\Source; | ||
|
||
class Groups | ||
{ | ||
#[ORM\Column(name: 'id', type: 'integer', nullable: false)] | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue(strategy: 'IDENTITY')] | ||
private $id; | ||
} |
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,15 @@ | ||
<?php | ||
|
||
/** @changelog https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Annotation/Route.php */ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symfony\Component\Serializer\Attribute; | ||
|
||
if (class_exists('Symfony\Component\Serializer\Attribute\Groups')) { | ||
return; | ||
} | ||
|
||
class Groups | ||
{ | ||
} |