-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php80] Handle nested attribute with constant on AnnotationAttributeR…
…ector (#1661)
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
...p80/Rector/Class_/AnnotationToAttributeRector/Fixture/nested_array_with_constants.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,43 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation; | ||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\ConstantReference; | ||
|
||
/** | ||
* @GenericAnnotation( | ||
* some={ | ||
* ConstantReference::FIRST_NAME={ | ||
* foo: {"bar"} | ||
* }, | ||
* ConstantReference::LAST_NAME | ||
* } | ||
* ) | ||
* @GenericAnnotation( | ||
* some={ | ||
* ConstantReference::LAST_NAME, | ||
* trailingValue | ||
* } | ||
* ) | ||
*/ | ||
final class ArrayWithConstantAsKey | ||
{ | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation; | ||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\ConstantReference; | ||
|
||
#[GenericAnnotation(some: [ConstantReference::FIRST_NAME => ['foo' => ['bar']], 0 => ConstantReference::LAST_NAME])] | ||
#[GenericAnnotation(some: [ConstantReference::LAST_NAME, 'trailingValue'])] | ||
final class ArrayWithConstantAsKey | ||
{ | ||
} | ||
|
||
?> |
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 |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
final class ConstantReference | ||
{ | ||
public const FIRST_NAME = 'firstName'; | ||
public const LAST_NAME = 'lastName'; | ||
} |