Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
7 / 14 |
|
41.67% |
5 / 12 |
CRAP | |
0.00% |
0 / 1 |
| WebdavRouteDefinition | |
50.00% |
7 / 14 |
|
41.67% |
5 / 12 |
30.00 | |
0.00% |
0 / 1 |
| getMethod | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getOperationId | |
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 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getInputType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getOutputType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPossibleActionResponseStatuses | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDescription | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTags | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRouteAttributes | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getUrlPrefixes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\Webdav\RouteDefinitions; |
| 3 | |
| 4 | use Apie\Common\Interfaces\HasActionDefinition; |
| 5 | use Apie\Common\Interfaces\HasRouteDefinition; |
| 6 | use Apie\Common\Lists\UrlPrefixList; |
| 7 | use Apie\Core\Actions\ActionResponseStatusList; |
| 8 | use Apie\Core\Dto\ListOf; |
| 9 | use Apie\Core\Enums\RequestMethod; |
| 10 | use Apie\Core\Lists\StringList; |
| 11 | use Apie\Core\ValueObjects\UrlRouteDefinition; |
| 12 | use Apie\Webdav\Controller\WebdavController; |
| 13 | use ReflectionClass; |
| 14 | use ReflectionMethod; |
| 15 | use ReflectionType; |
| 16 | |
| 17 | class WebdavRouteDefinition implements HasRouteDefinition, HasActionDefinition |
| 18 | { |
| 19 | public function getMethod(): RequestMethod |
| 20 | { |
| 21 | return RequestMethod::ANY; |
| 22 | } |
| 23 | |
| 24 | public function getOperationId(): string |
| 25 | { |
| 26 | return 'apie_webdav'; |
| 27 | } |
| 28 | |
| 29 | public function getUrl(): UrlRouteDefinition |
| 30 | { |
| 31 | return new UrlRouteDefinition('/webdav/{path}'); |
| 32 | } |
| 33 | |
| 34 | public function getController(): string |
| 35 | { |
| 36 | return WebdavController::class; |
| 37 | } |
| 38 | |
| 39 | public function getAction(): string |
| 40 | { |
| 41 | return '__invoke'; |
| 42 | } |
| 43 | |
| 44 | public function getInputType(): ReflectionClass|ReflectionMethod|ReflectionType |
| 45 | { |
| 46 | return new ReflectionClass(StringList::class); |
| 47 | } |
| 48 | |
| 49 | public function getOutputType(): ReflectionClass|ReflectionMethod|ReflectionType|ListOf |
| 50 | { |
| 51 | return new ReflectionClass(StringList::class); |
| 52 | } |
| 53 | |
| 54 | public function getPossibleActionResponseStatuses(): ActionResponseStatusList |
| 55 | { |
| 56 | return new ActionResponseStatusList(); |
| 57 | } |
| 58 | |
| 59 | public function getDescription(): string |
| 60 | { |
| 61 | return 'Webdav'; |
| 62 | } |
| 63 | |
| 64 | public function getTags(): StringList |
| 65 | { |
| 66 | return new StringList(['webdav']); |
| 67 | } |
| 68 | |
| 69 | public function getRouteAttributes(): array |
| 70 | { |
| 71 | return [ |
| 72 | 'path' => '', |
| 73 | ]; |
| 74 | } |
| 75 | |
| 76 | public function getUrlPrefixes(): UrlPrefixList |
| 77 | { |
| 78 | return new UrlPrefixList([]); |
| 79 | } |
| 80 | } |