-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the option to use the annotation value as an argument to th…
…e attribute (#6468)
- Loading branch information
1 parent
fb169fa
commit 1ec42bc
Showing
6 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...ts/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/with_value_as_argument.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,37 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture; | ||
|
||
final class WithValueAsArgument | ||
{ | ||
/** | ||
* @When this is a simple annotation with a value | ||
* @When | ||
* @When "this value is within quotes" | ||
* @When this value has a ' character | ||
* @When(key="value") this annotation has parameters so won't use this option | ||
*/ | ||
public function someStep(): void | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture; | ||
|
||
final class WithValueAsArgument | ||
{ | ||
#[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('this is a simple annotation with a value')] | ||
#[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When] | ||
#[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('"this value is within quotes"')] | ||
#[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('this value has a \' character')] | ||
#[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When(key: 'value')] // this annotation has parameters so won't use this option | ||
public function someStep(): void | ||
{ | ||
} | ||
} | ||
|
||
?> |
9 changes: 9 additions & 0 deletions
9
rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Attribute/Behat/When.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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat; | ||
|
||
final class When | ||
{ | ||
} |
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