File tree Expand file tree Collapse file tree
rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat
rules/Php80/Rector/Class_ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace Rector \Tests \Php80 \Rector \Class_ \AnnotationToAttributeRector \Fixture \Behat ;
44
5- use Behat \Step \Then ;
6-
75final class MissedSlashes
86{
97 /**
@@ -20,8 +18,6 @@ final class MissedSlashes
2018
2119namespace Rector \Tests \Php80 \Rector \Class_ \AnnotationToAttributeRector \Fixture \Behat ;
2220
23- use Behat \Step \Then ;
24-
2521final class MissedSlashes
2622{
2723 #[\Behat \Step \Then('some message ' )]
Original file line number Diff line number Diff line change 77use Nette \Utils \Strings ;
88use PHPStan \PhpDocParser \Ast \PhpDoc \PhpDocTagNode ;
99use Rector \BetterPhpDocParser \PhpDoc \DoctrineAnnotationTagValueNode ;
10- use Rector \NodeTypeResolver \Node \AttributeKey ;
1110use Rector \Php80 \ValueObject \AnnotationToAttribute ;
1211use Rector \Php80 \ValueObject \AttributeValueAndDocComment ;
1312use Rector \Util \NewLineSplitter ;
@@ -33,13 +32,7 @@ public function resolve(
3332 if ($ phpDocTagNode ->value instanceof DoctrineAnnotationTagValueNode) {
3433 $ originalContent = (string ) $ phpDocTagNode ->value ->getOriginalContent ();
3534
36- if ($ docValue === '' ) {
37- $ attributeComment = (string ) $ phpDocTagNode ->value ->getAttribute (AttributeKey::ATTRIBUTE_COMMENT );
38-
39- if ($ originalContent === $ attributeComment ) {
40- $ docValue = $ originalContent ;
41- }
42- } else {
35+ if ($ docValue !== '' ) {
4336 $ attributeComment = ltrim ($ originalContent , $ docValue );
4437 if ($ attributeComment !== '' ) {
4538 $ docValue .= "\n" . $ attributeComment ;
Original file line number Diff line number Diff line change 99use PhpParser \Internal \TokenStream ;
1010use PhpParser \Node ;
1111use PhpParser \Node \Arg ;
12- use PhpParser \Node \AttributeGroup ;
1312use PhpParser \Node \Expr ;
1413use PhpParser \Node \Expr \Array_ ;
1514use PhpParser \Node \Expr \ArrowFunction ;
You can’t perform that action at this time.
0 commit comments