Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Route | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\Attributes; |
| 3 | |
| 4 | use Apie\Core\Enums\RequestMethod; |
| 5 | use Attribute; |
| 6 | |
| 7 | /** |
| 8 | * For Apie actions, provide a Route url. |
| 9 | */ |
| 10 | #[Attribute(Attribute::TARGET_METHOD|Attribute::IS_REPEATABLE)] |
| 11 | final class Route |
| 12 | { |
| 13 | public const CMS = 'cms'; |
| 14 | public const ALL = 'all'; |
| 15 | public const API = 'api'; |
| 16 | |
| 17 | public function __construct( |
| 18 | public readonly string $routeDefinition, |
| 19 | public readonly ?RequestMethod $requestMethod = null, |
| 20 | public readonly string $target = self::ALL |
| 21 | ) { |
| 22 | } |
| 23 | } |