Skip to content

Commit

Permalink
use attribute for api-platform 2
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Oct 24, 2024
1 parent 807b6dd commit 5349d4a
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tests/Functional/EntityExcluded/ApiPlatform2/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

/**
* @author Guilhem N. <[email protected]>
*
* @ApiResource(
* collectionOperations={
* "get"={"method"="GET"},
* "custom2"={"path"="/foo", "method"="GET"},
* "custom"={"path"="/foo", "method"="POST"},
* },
* itemOperations={"get"={"method"="GET"}})
* )
*/
#[ApiResource(
collectionOperations: [
'get' => ['method' => 'GET'],
'custom2' => ['path' => '/foo', 'method' => 'GET'],
'custom' => ['path' => '/foo', 'method' => 'POST'],
],
itemOperations: ['get' => ['method' => 'GET']]
)]
class Dummy
{
/**
Expand All @@ -36,11 +35,9 @@ class Dummy

/**
* @var string
*
* @Assert\NotBlank
*
* @ApiProperty(iri="http://schema.org/name")
*/
#[Assert\NotBlank]
#[ApiProperty(iri: 'http://schema.org/name')]
private $name;

public function getId(): int
Expand Down

0 comments on commit 5349d4a

Please sign in to comment.