Skip to content

Commit

Permalink
[Php81] Handle after open parentheses on AnnotationToAttributeRector (#…
Browse files Browse the repository at this point in the history
…5613)

* [Php81] Handle after open parentheses on AnnotationToAttributeRector

* roll

* fix
  • Loading branch information
samsonasik committed Feb 13, 2024
1 parent 7afec9a commit 95f9772
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
@@ -0,0 +1,28 @@
<?php

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

/**
* @\Doctrine\ORM\Mapping\Table(
* uniqueConstraints={
* @\Doctrine\ORM\Mapping\UniqueConstraint(name="some_key")
* }
* )
*/
final class AfterOpenParentheses
{
}

?>
-----
<?php

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

#[\Doctrine\ORM\Mapping\Table]
#[\Doctrine\ORM\Mapping\UniqueConstraint(name: 'some_key')]
final class AfterOpenParentheses
{
}

?>
Expand Up @@ -485,6 +485,10 @@ private function resolveAnnotationContent(string $annotationContent, array $nest
return $annotationContent;
}

if ($trimmedNestedAnnotationOpen === '') {
return $annotationContent;
}

return '("' . trim($trimmedNestedAnnotationOpen, '"\'') . '")';
}
}

0 comments on commit 95f9772

Please sign in to comment.