Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
tests/Fixtures/TestBundle/ApiResource/OperationPriorities.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <dunglas@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Tests\Fixtures\TestBundle\ApiResource; | ||
|
||
use ApiPlatform\Metadata\Get; | ||
|
||
#[Get(name: 'a', priority: -1, uriTemplate: 'operation_priority/{id}', provider: [self::class, 'shouldNotBeCalled'])] | ||
#[Get(name: 'b', priority: 1, uriTemplate: 'operation_priority/{id}', provider: [self::class, 'shouldBeCalled'])] | ||
class OperationPriorities | ||
{ | ||
public int $id = 1; | ||
|
||
public static function shouldBeCalled(): self | ||
{ | ||
return new self(); | ||
} | ||
|
||
public static function shouldNotBeCalled(): self | ||
{ | ||
throw new \Exception('fail'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters