Skip to content

Commit d549d62

Browse files
authored
Add back removed fixture aliased multi properties on AnnotationToAttributeRector (#7549)
* Add back removed fixture aliased multi properties on AnnotationToAttributeRector * move SomeProperty to Source * update fixture namespace * final touch: rename class fixture
1 parent cd98f08 commit d549d62

3 files changed

Lines changed: 55 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
6+
7+
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Annotation as OA;
8+
9+
class AliasedWithMultiProperties
10+
{
11+
/**
12+
* @OA\SomeProperty(type="string")
13+
*/
14+
public $property1;
15+
16+
/**
17+
* @OA\SomeProperty(type="string")
18+
*/
19+
public $property2;
20+
}
21+
22+
?>
23+
-----
24+
<?php
25+
26+
declare(strict_types=1);
27+
28+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
29+
30+
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute as OA;
31+
32+
class AliasedWithMultiProperties
33+
{
34+
#[OA\SomeProperty(type: 'string')]
35+
public $property1;
36+
37+
#[OA\SomeProperty(type: 'string')]
38+
public $property2;
39+
}
40+
41+
?>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute;
6+
7+
#[\Attribute]
8+
final class SomeProperty
9+
{
10+
}

rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/config/configured_rule.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
new AnnotationToAttribute('OldName2', NewName2::class),
6868
new AnnotationToAttribute('SameName', SameName::class),
6969

70-
new AnnotationToAttribute('OpenApi\Annotations\Property', 'OpenApi\Attributes\Property'),
70+
new AnnotationToAttribute(
71+
'Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Annotation\SomeProperty',
72+
'Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute\SomeProperty'
73+
),
7174
]);
7275
};

0 commit comments

Comments
 (0)