Test Failed
Push — master ( 99a915...bca16c )
by Vítězslav
07:03
created

Status::getVazby()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
/**
3
 * FlexiPeeHP - FlexiBee Server Status class.
4
 *
5
 * @author     Vítězslav Dvořák <[email protected]>
6
 * @copyright  (C) 2016-2017 Spoje.Net
7
 */
8
9
namespace FlexiPeeHP;
10
11
/**
12
 * Description of Status
13
 *
14
 * @author vitex
15
 */
16
class Status extends FlexiBeeRO
17
{
18
    /**
19
     * Evidence užitá objektem.
20
     * Evidence used by object
21
     *
22
     * @link https://demo.flexibee.eu/c/demo/evidence-list Přehled evidencí
23
     * @var string
24
     */
25
    public $evidence = 'status';
26
27
    /**
28
     * @link https://demo.flexibee.eu/devdoc/company-identifier Identifikátor firmy
29
     * @var string
30
     */
31
    public $company = '';
32
33
    /**
34
     * Default Line Prefix.
35
     *
36
     * @var string
37
     */
38
    public $prefix = '';
39
40
    /**
41
     * FlexiBee status
42
     *
43
     * @param mixed $init       mostly ignored
44
     * @param array $options    not used at all
45
     */
46 3
    public function __construct($init = null, $options = [])
47
    {
48 3
        parent::__construct($init, $options);
49 3
        $this->takeData($this->getFlexiData('/'.$this->evidence));
50 3
    }
51
52
    /**
53
     * Return the same response format for one and multiplete results
54
     *
55
     * @param array $responseRaw
56
     * @return array
57
     */
58 4
    public function unifyResponseFormat($responseRaw)
59
    {
60 4
        if (array_key_exists('status', $responseRaw)) {
61 4
            $response = $responseRaw['status'];
62 4
        } else {
63 1
            $response = $responseRaw;
64
        }
65 4
        return $response;
66
    }
67
68
    /**
69
     * Status has no relations
70
     *
71
     * @return null
72
     */
73
    public function getVazby($id = null)
74
    {
75
        throw new \Exception(_('Status has no relations'));
76
    }
77
}
78