Completed
Push — master ( 41ec40...fd6b09 )
by Vítězslav
03:26
created

Status::unifyResponseFormat()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
/**
3
 * FlexiPeeHP - FlexiBee Server Status class.
4
 *
5
 * @author     Vítězslav Dvořák <[email protected]>
6
 * @copyright  (C) 2016 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
    public function __construct($init = null, $options = array())
41
    {
42
        parent::__construct($init, $options);
43
        $this->takeData($this->getFlexiData());
44
    }
45
46
    /**
47
     * Return the same response format for one and multiplete results
48
     *
49
     * @param array $responseRaw
50
     * @return array
51
     */
52
    public function unifyResponseFormat($responseRaw)
53
    {
54
        if (array_key_exists('status', $responseRaw)) {
55
            $response = $responseRaw['status'];
56
        } else {
57
            $response = $responseRaw;
58
        }
59
        return $response;
60
    }
61
}
62