getSubject(); $request = $controller->getRequest(); $attributes = []; foreach ($request->getAttributes() as $attr => $value) { try { serialize($value); } catch (Exception $e) { $value = "Could not serialize `{$attr}`. It failed with {$e->getMessage()}"; } $attributes[$attr] = $value; } $this->_data = [ 'attributes' => $attributes, 'query' => $request->getQueryParams(), 'data' => $request->getData(), 'cookie' => $request->getCookieParams(), 'get' => $_GET, 'matchedRoute' => $request->getParam('_matchedRoute'), 'headers' => ['response' => headers_sent($file, $line), 'file' => $file, 'line' => $line], ]; } }