diff --git a/src/Resources/skeleton/doctrine/Entity.tpl.php b/src/Resources/skeleton/doctrine/Entity.tpl.php index 03ff5d373b..8056af0566 100644 --- a/src/Resources/skeleton/doctrine/Entity.tpl.php +++ b/src/Resources/skeleton/doctrine/Entity.tpl.php @@ -8,12 +8,15 @@ use Doctrine\ORM\Mapping as ORM; /** - * @ApiResource() + * @ApiResource() * @ORM\Entity(repositoryClass=::class) * @ORM\Table(name="``") */ + +#[ApiResource] + class { /** diff --git a/tests/Maker/MakeEntityTest.php b/tests/Maker/MakeEntityTest.php index d39fe2257a..223dcb5974 100644 --- a/tests/Maker/MakeEntityTest.php +++ b/tests/Maker/MakeEntityTest.php @@ -52,7 +52,7 @@ public function getTestDetails() $content = file_get_contents($directory.'/src/Entity/User.php'); $this->assertStringContainsString('use ApiPlatform\Core\Annotation\ApiResource;', $content); - $this->assertStringContainsString('@ApiResource', $content); + $this->assertStringContainsString(\PHP_VERSION_ID >= 80000 ? '#[ApiResource]' : '@ApiResource', $content); }), ]; diff --git a/tests/tmp/.gitignore b/tests/tmp/.gitignore deleted file mode 100644 index e69de29bb2..0000000000