Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
| DropdownOptionsForNewObjectRouteDefinition | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
| getMethod | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUrl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getController | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAction | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getOperationId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUrlPrefixes | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\CmsApiDropdownOption\RouteDefinitions; |
| 3 | |
| 4 | use Apie\CmsApiDropdownOption\Actions\DropdownOptionsAction; |
| 5 | use Apie\CmsApiDropdownOption\Controllers\DropdownOptionController; |
| 6 | use Apie\Common\Enums\UrlPrefix; |
| 7 | use Apie\Common\Lists\UrlPrefixList; |
| 8 | use Apie\Common\RouteDefinitions\AbstractRestApiRouteDefinition; |
| 9 | use Apie\Core\Enums\RequestMethod; |
| 10 | use Apie\Core\ValueObjects\UrlRouteDefinition; |
| 11 | |
| 12 | class DropdownOptionsForNewObjectRouteDefinition extends AbstractRestApiRouteDefinition |
| 13 | { |
| 14 | public function getMethod(): RequestMethod |
| 15 | { |
| 16 | return RequestMethod::POST; |
| 17 | } |
| 18 | |
| 19 | public function getUrl(): UrlRouteDefinition |
| 20 | { |
| 21 | return new UrlRouteDefinition($this->class->getShortName() . '/dropdown-options/{property}'); |
| 22 | } |
| 23 | |
| 24 | public function getController(): string |
| 25 | { |
| 26 | return DropdownOptionController::class; |
| 27 | } |
| 28 | |
| 29 | public function getAction(): string |
| 30 | { |
| 31 | return DropdownOptionsAction::class; |
| 32 | } |
| 33 | |
| 34 | public function getOperationId(): string |
| 35 | { |
| 36 | return 'cms.dropdown_options.' . $this->class->getShortName(); |
| 37 | } |
| 38 | |
| 39 | final public function getUrlPrefixes(): UrlPrefixList |
| 40 | { |
| 41 | return new UrlPrefixList([UrlPrefix::CMS, UrlPrefix::API]); |
| 42 | } |
| 43 | } |