Sessions::open()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Rs\VersionEye\Output;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
/**
8
 * Sessions.
9
 *
10
 * @author Robert Schönthal <[email protected]>
11
 */
12
class Sessions extends BaseOutput
13
{
14
    /**
15
     * output for show API.
16
     *
17
     * @param OutputInterface $output
18
     * @param array           $response
19
     */
20 1
    public function show(OutputInterface $output, array $response)
21
    {
22 1
        $this->printList($output,
23 1
            ['Fullname', 'API Token'],
24 1
            ['fullname', 'api_key'],
25 1
            $response
26
        );
27 1
    }
28
29
    /**
30
     * output for open API.
31
     *
32
     * @param OutputInterface $output
33
     * @param array           $response
34
     */
35 1
    public function open(OutputInterface $output, $response)
36
    {
37 1
        $this->printBoolean($output, 'OK', 'FAIL', 'true' === $response); //response isnt an array oO
38 1
    }
39
40
    /**
41
     * output for close API.
42
     *
43
     * @param OutputInterface $output
44
     * @param array           $response
45
     */
46 1
    public function close(OutputInterface $output, array $response)
47
    {
48 1
        $this->printBoolean($output, 'OK', 'FAIL', 'Session is closed now.' === $response['message']);
49 1
    }
50
}
51