| Total Complexity | 2 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final readonly class DonutRequest implements Stringable |
||
|
|
|||
| 14 | { |
||
| 15 | public function __construct( |
||
| 16 | private AbstractRequest $request, |
||
| 17 | private DonutRendererInterface $donutStorage, |
||
| 18 | private SurrogateKeys $etags, |
||
| 19 | ) { |
||
| 20 | } |
||
| 21 | |||
| 22 | #[Override] |
||
| 23 | public function __toString(): string |
||
| 24 | { |
||
| 25 | $view = (string) ($this->request)(); |
||
| 26 | $uri = (string) $this->request->resourceObject->uri; |
||
| 27 | $this->etags->addTag($this->request->resourceObject); |
||
| 28 | $this->donutStorage->setView($uri, $view); |
||
| 29 | |||
| 30 | return sprintf(ResourceDonut::FOMRAT, $uri); |
||
| 31 | } |
||
| 33 |