File tree Expand file tree Collapse file tree 3 files changed +90
-1
lines changed
rules-tests/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector/Fixture
rules/AnnotationsToAttributes/Rector/ClassMethod Expand file tree Collapse file tree 3 files changed +90
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \PHPUnit \Tests \AnnotationsToAttributes \Rector \ClassMethod \DataProviderAnnotationToAttributeRector \Fixture ;
4+
5+ class WithCommentAbove extends \PHPUnit \Framework \TestCase
6+ {
7+ /**
8+ * This is a useless test to demonstrate a problem.
9+ *
10+ * @dataProvider dataProvider
11+ */
12+ public function testProvider (bool $ expected ): void
13+ {
14+ self ::assertSame ($ expected , $ expected );
15+ }
16+
17+ public static function dataProvider (): iterable
18+ {
19+ yield [true ];
20+ }
21+ }
22+
23+ ?>
24+ -----
25+ <?php
26+
27+ namespace Rector \PHPUnit \Tests \AnnotationsToAttributes \Rector \ClassMethod \DataProviderAnnotationToAttributeRector \Fixture ;
28+
29+ class WithCommentAbove extends \PHPUnit \Framework \TestCase
30+ {
31+ /**
32+ * This is a useless test to demonstrate a problem.
33+ */
34+ #[\PHPUnit \Framework \Attributes \DataProvider('dataProvider ' )]
35+ public function testProvider (bool $ expected ): void
36+ {
37+ self ::assertSame ($ expected , $ expected );
38+ }
39+
40+ public static function dataProvider (): iterable
41+ {
42+ yield [true ];
43+ }
44+ }
45+
46+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \PHPUnit \Tests \AnnotationsToAttributes \Rector \ClassMethod \DataProviderAnnotationToAttributeRector \Fixture ;
4+
5+ class WithCommentBelow extends \PHPUnit \Framework \TestCase
6+ {
7+ /**
8+ * @dataProvider dataProvider
9+ *
10+ * This is a useless test to demonstrate a problem.
11+ */
12+ public function testProvider (bool $ expected ): void
13+ {
14+ self ::assertSame ($ expected , $ expected );
15+ }
16+
17+ public static function dataProvider (): iterable
18+ {
19+ yield [true ];
20+ }
21+ }
22+
23+ ?>
24+ -----
25+ <?php
26+
27+ namespace Rector \PHPUnit \Tests \AnnotationsToAttributes \Rector \ClassMethod \DataProviderAnnotationToAttributeRector \Fixture ;
28+
29+ class WithCommentBelow extends \PHPUnit \Framework \TestCase
30+ {
31+ #[\PHPUnit \Framework \Attributes \DataProvider('dataProvider ' )]
32+ public function testProvider (bool $ expected ): void
33+ {
34+ self ::assertSame ($ expected , $ expected );
35+ }
36+
37+ public static function dataProvider (): iterable
38+ {
39+ yield [true ];
40+ }
41+ }
42+
43+ ?>
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public function refactor(Node $node): ?Node
138138
139139 $ originalAttributeValue = $ desiredTagValueNode ->value ->value ;
140140
141- $ node ->attrGroups [] = $ this ->createAttributeGroup ($ originalAttributeValue );
141+ $ node ->attrGroups [] = $ this ->createAttributeGroup (strtok ( $ originalAttributeValue, " \t\n\r\0\x0B" ) );
142142
143143 // cleanup
144144 $ this ->phpDocTagRemover ->removeTagValueFromNode ($ phpDocInfo , $ desiredTagValueNode );
You can’t perform that action at this time.
0 commit comments