view = $view; } public function __invoke(Request $request, $handler) { // add running app version $composer = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true); $this->view->getEnvironment()->addGlobal('APP_VERSION', $composer['version'] ?? 'unknown'); // add running PHP version $this->view->getEnvironment()->addGlobal('PHP_VERSION', PHP_VERSION); return $handler->handle($request); } }