Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;

use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Annotation as OA;

class AliasedWithMultiProperties
{
/**
* @OA\SomeProperty(type="string")
*/
public $property1;

/**
* @OA\SomeProperty(type="string")
*/
public $property2;
}

?>
-----
<?php

declare(strict_types=1);

namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;

use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute as OA;

class AliasedWithMultiProperties
{
#[OA\SomeProperty(type: 'string')]
public $property1;

#[OA\SomeProperty(type: 'string')]
public $property2;
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute;

#[\Attribute]
final class SomeProperty
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
new AnnotationToAttribute('OldName2', NewName2::class),
new AnnotationToAttribute('SameName', SameName::class),

new AnnotationToAttribute('OpenApi\Annotations\Property', 'OpenApi\Attributes\Property'),
new AnnotationToAttribute(
'Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Annotation\SomeProperty',
'Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\OpenApi\Attribute\SomeProperty'
),
]);
};