| 1 | <?php |
||
| 22 | class ContextDataCollector extends DataCollector |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var Context |
||
| 26 | */ |
||
| 27 | protected $context; |
||
| 28 | |||
| 29 | 70 | public function __construct($context) |
|
| 33 | |||
| 34 | 2 | public function collect(Request $request, Response $response, \Exception $exception = null) |
|
| 35 | { |
||
| 36 | 2 | $this->data = [ |
|
| 37 | 2 | 'currentPage' => null !== $this->context->getCurrentPage() ? get_object_vars($this->context->getCurrentPage()) : [], |
|
| 38 | 2 | 'registeredMeta' => $this->context->getRegisteredMeta(), |
|
| 39 | ]; |
||
| 40 | 2 | } |
|
| 41 | |||
| 42 | public function getData() |
||
| 43 | { |
||
| 44 | return $this->data; |
||
| 45 | } |
||
| 46 | |||
| 47 | 70 | public function getName() |
|
| 51 | } |
||
| 52 |