Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit 85fee61

Browse files
author
Robert Kummer
authored
Merge pull request #17 from ipunkt/analysis-8KrMEA
Apply fixes from StyleCI
2 parents 12f874f + 56ef710 commit 85fee61

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

app/Http/Controllers/Api/HealthController.php

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,22 @@
44

55
class HealthController extends ApiController
66
{
7-
public function health()
8-
{
9-
10-
if ( file_put_contents( storage_path('health.txt'), date('Y-m-d H:i:s') ) === FALSE)
11-
return $this->respond(503, 'storage unavailable' );
12-
13-
return $this->respond(200, 'healthy');
14-
}
15-
16-
/**
17-
*
18-
*/
19-
private function respond($code, $message)
20-
{
21-
22-
$data = [
23-
'status' => $code,
24-
'message' => $message,
25-
];
26-
27-
return $this->respondData($data, $code);
28-
}
29-
7+
public function health()
8+
{
9+
if (file_put_contents(storage_path('health.txt'), date('Y-m-d H:i:s')) === false) {
10+
return $this->respond(503, 'storage unavailable');
11+
}
12+
13+
return $this->respond(200, 'healthy');
14+
}
15+
16+
private function respond($code, $message)
17+
{
18+
$data = [
19+
'status' => $code,
20+
'message' => $message,
21+
];
22+
23+
return $this->respondData($data, $code);
24+
}
3025
}

0 commit comments

Comments
 (0)