Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
90.91% covered (success)
90.91%
10 / 11
88.89% covered (warning)
88.89%
8 / 9
CRAP
0.00% covered (danger)
0.00%
0 / 1
LastActionResultRouteDefinition
90.91% covered (success)
90.91%
10 / 11
88.89% covered (warning)
88.89%
8 / 9
9.06
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getMethod
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getUrl
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getMainMenuUri
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getController
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRouteAttributes
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 getOperationId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAction
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getUrlPrefixes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Cms\RouteDefinitions;
3
4use Apie\Cms\Controllers\LastActionResultController;
5use Apie\Common\Actions\GetListAction;
6use Apie\Common\Enums\UrlPrefix;
7use Apie\Common\Interfaces\HasRouteDefinition;
8use Apie\Common\Lists\UrlPrefixList;
9use Apie\Core\BoundedContext\BoundedContextId;
10use Apie\Core\ContextConstants;
11use Apie\Core\Enums\RequestMethod;
12use Apie\Core\ValueObjects\UrlRouteDefinition;
13
14class LastActionResultRouteDefinition implements HasRouteDefinition
15{
16    public function __construct(private readonly BoundedContextId $id)
17    {
18    }
19
20    public function getMethod(): RequestMethod
21    {
22        return RequestMethod::GET;
23    }
24
25    public function getUrl(): UrlRouteDefinition
26    {
27        return new UrlRouteDefinition('/last-action-result/{id}');
28    }
29
30    public function getMainMenuUri(): ?UrlRouteDefinition
31    {
32        return null;
33    }
34    /**
35     * @return class-string<object>
36     */
37    public function getController(): string
38    {
39        return LastActionResultController::class;
40    }
41    /**
42     * @return array<string, mixed>
43     */
44    public function getRouteAttributes(): array
45    {
46        return [
47            ContextConstants::BOUNDED_CONTEXT_ID => $this->id->toNative(),
48        ];
49    }
50    public function getOperationId(): string
51    {
52        return 'cms.last-action-result';
53    }
54
55    public function getAction(): string
56    {
57        return GetListAction::class;
58    }
59
60    public function getUrlPrefixes(): UrlPrefixList
61    {
62        return new UrlPrefixList([UrlPrefix::CMS]);
63    }
64}