Skip to content
Permalink
Browse files

refactor: No more relative path to `composer.json`

  • Loading branch information...
tarlepp committed Aug 6, 2019
1 parent 1ee3793 commit 3e2802ecf25b6c0479bb157bee8c8a5e211749b3
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/Controller/DefaultController.php
@@ -114,17 +114,19 @@ public function healthzAction(
* ),
* )
*
* @param string $projectDir
*
* @return JsonResponse
*
* @throws Throwable
*/
public function versionAction(): JsonResponse
public function versionAction(string $projectDir): JsonResponse
{
/** @var stdClass $composerData */
$composerData = JSON::decode((string)file_get_contents(__DIR__ . '/../../composer.json'));
$composerData = JSON::decode((string)file_get_contents($projectDir . '/composer.json'));
$data = [
'version' => $composerData->version,
'version' => $composerData->version ?? '0.0.0',
];
return new JsonResponse($data);

0 comments on commit 3e2802e

Please sign in to comment.
You can’t perform that action at this time.