| Total Complexity | 6 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Context implements ContextInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var ViewModelInterface |
||
| 15 | */ |
||
| 16 | private $view; |
||
| 17 | /** |
||
| 18 | * @var DatasourceRegistry |
||
| 19 | */ |
||
| 20 | private $datasources = []; |
||
| 21 | /** |
||
| 22 | * @var RequestInterface |
||
| 23 | */ |
||
| 24 | private $request = null; |
||
| 25 | |||
| 26 | public function __construct( |
||
| 27 | ViewModelInterface $view, |
||
| 28 | RequestInterface $request, |
||
| 29 | ?DatasourceRegistry $datasourceRegistry = null |
||
| 30 | ) { |
||
| 31 | $this->view = $view; |
||
| 32 | $this->request = $request; |
||
| 33 | $this->datasources = $datasourceRegistry; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getView(): ViewModelInterface |
||
| 37 | { |
||
| 38 | return $this->view; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getDatasources(): ?DatasourceRegistry |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getRequest(): RequestInterface |
||
| 47 | { |
||
| 48 | return $this->request; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function setDatasources(DatasourceRegistry $datasourceRegistry): void |
||
| 52 | { |
||
| 53 | $this->datasources = $datasourceRegistry; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function toArray(): array |
||
| 62 | ]; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |