-
-
Notifications
You must be signed in to change notification settings - Fork 335
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 annotation not end with () on AnnotationToAttri…
…buteRector (#3017) Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
478cf14
commit 4bf1587
Showing
4 changed files
with
126 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
33 changes: 33 additions & 0 deletions
33
...tionToAttributeRector/FixturePhp81/multiple_nested_attributes_without_parentheses.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class MultipleNestedAttributeWithoutParentheses | ||
{ | ||
/** | ||
* @Assert\All({ | ||
* @Assert\NotNull, | ||
* @Assert\NotNumber(secondValue=1000), | ||
* @Assert\NotNumber(hey=10, hi="hello"), | ||
* }) | ||
*/ | ||
public $value; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class MultipleNestedAttributeWithoutParentheses | ||
{ | ||
#[Assert\All([new Assert\NotNull(), new Assert\NotNumber(secondValue: 1000), new Assert\NotNumber(hey: 10, hi: 'hello')])] | ||
public $value; | ||
} | ||
|
||
?> |
31 changes: 31 additions & 0 deletions
31
...s_/AnnotationToAttributeRector/FixturePhp81/nested_attributes_without_parentheses.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,31 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class NestedAttributeWithoutParentheses | ||
{ | ||
/** | ||
* @Assert\All({ | ||
* @Assert\NotNull | ||
* }) | ||
*/ | ||
public $value; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class NestedAttributeWithoutParentheses | ||
{ | ||
#[Assert\All([new Assert\NotNull()])] | ||
public $value; | ||
} | ||
|
||
?> |
29 changes: 29 additions & 0 deletions
29
..._/AnnotationToAttributeRector/FixturePhp81/nested_attributes_without_parentheses2.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,29 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class NestedAttributeWithoutParentheses2 | ||
{ | ||
/** | ||
* @Assert\All({@Assert\NotNull}) | ||
*/ | ||
public $value; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\FixturePhp81; | ||
|
||
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\SourcePhp81 as Assert; | ||
|
||
final class NestedAttributeWithoutParentheses2 | ||
{ | ||
#[Assert\All([new Assert\NotNull()])] | ||
public $value; | ||
} | ||
|
||
?> |