StatusController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 42
ccs 12
cts 12
cp 1
rs 10
wmc 3
lcom 1
cbo 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A index() 0 6 1
A show() 0 6 1
1
<?php
2
3
namespace Sausin\Signere\Http\Controllers\Admin;
4
5
use Sausin\Signere\Status;
6
use Sausin\Signere\Http\Controllers\Controller;
7
8
class StatusController extends Controller
9
{
10
    /** @var \Sausin\Signere\Status */
11
    protected $status;
12
13
    /**
14
     * Create a new controller instance.
15
     *
16
     * @param  \Sausin\Signere\Status $status
17
     */
18 2
    public function __construct(Status $status)
19
    {
20 2
        parent::__construct();
21
22 2
        $this->status = $status;
23 2
    }
24
25
    /**
26
     * Returns the UTC time of the Signere server.
27
     *
28
     * @return \Illuminate\Http\Response
29
     */
30 1
    public function index()
31
    {
32 1
        return $this->status->getServerTime()
33 1
                ->getBody()
34 1
                ->getContents();
35
    }
36
37
    /**
38
     * Check if Signere service is operational.
39
     *
40
     * @param  string $message
41
     * @return \Illuminate\Http\Response
42
     */
43 1
    public function show(string $message)
44
    {
45 1
        return $this->status->getServerStatus($message)
46 1
                ->getBody()
47 1
                ->getContents();
48
    }
49
}
50