viewHandler = $viewHandler; } /** * @SWG\Response( * response=200, * description="A simple route that returns a 'pong', which you can use for testing the API", * examples={"{'message': 'pong'}"} * ) * * @Rest\Get(path="/ping") */ public function pingAction() { $view = new View(['message' => 'pong'], 200); return $this->viewHandler->handle($view); } /** * @SWG\Response( * response=200, * description="Returns version information about the current release", * ) * * @Rest\Get(path="/version") */ public function versionAction() { $version = [ 'version' => Constants::VERSION, 'candidate' => Constants::STATUS, 'semver' => Constants::VERSION . '-' . Constants::STATUS, 'name' => Constants::NAME, 'copyright' => 'Kimai 2 - ' . Constants::VERSION . ' ' . Constants::STATUS . ' (' . Constants::NAME . ') by Kevin Papst and contributors.', ]; return $this->viewHandler->handle(new View($version, 200)); } }