1 | <?php |
||
16 | class Company extends FlexiBeeRW |
||
17 | { |
||
18 | /** |
||
19 | * Základní namespace pro komunikaci s FlexiBEE. |
||
20 | * |
||
21 | * @var string Jmený prostor datového bloku odpovědi |
||
22 | */ |
||
23 | public $nameSpace = 'companies'; |
||
24 | |||
25 | /** |
||
26 | * Default Line Prefix. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | public $prefix = '/c'; |
||
31 | |||
32 | /** |
||
33 | * Company. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | public $evidence = ''; |
||
38 | |||
39 | /** |
||
40 | * Tato třída nepracuje sezvolenou firmou. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | public $company = ''; |
||
45 | |||
46 | public $myKeyColumn = 'dbNazev'; |
||
47 | |||
48 | /** |
||
49 | * Zinicializuje objekt dle daných dat. Možné hodnoty: |
||
50 | * |
||
51 | * * ['dbNazev'=>'company'] - load company form FlexiBee |
||
52 | * * 234 - interní číslo záznamu k načtení |
||
53 | * * code:LOPATA - kód záznamu |
||
54 | * * BAGR - kód záznamu k načtení |
||
55 | * * ['id'=>24,'nazev'=>'hoblík'] - pole hodnot k předvyplnění |
||
56 | * * 743.json?relations=adresa,vazby - část url s parametry k načtení |
||
57 | * |
||
58 | * @param mixed $init číslo/"(code:)kód"/(část)URI záznamu k načtení | pole hodnot k předvyplnění |
||
59 | */ |
||
60 | 1 | public function processInit($init) |
|
70 | |||
71 | /** |
||
72 | * Vrací základní URL pro užitou evidenci |
||
73 | * |
||
74 | * @link https://www.flexibee.eu/api/dokumentace/ref/urls/ Sestavování URL |
||
75 | * @param string $urlSuffix |
||
76 | */ |
||
77 | 1 | public function getEvidenceURL($urlSuffix = null) |
|
89 | |||
90 | /** |
||
91 | * Vrací název evidence použité v odpovědích z FlexiBee |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | 2 | public function getResponseEvidence() |
|
99 | |||
100 | /** |
||
101 | * Parse Raw FlexiBee response in several formats |
||
102 | * |
||
103 | * @param string $responseRaw raw response body |
||
104 | * @param string $format Raw Response format json|xml|etc |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | 1 | public function rawResponseToArray($responseRaw, $format) |
|
120 | |||
121 | /** |
||
122 | * Save company backup to file |
||
123 | * |
||
124 | * @param string $filename |
||
125 | * |
||
126 | * @return boolean was backup saved to file ? |
||
127 | */ |
||
128 | public function saveBackupTo($filename) |
||
144 | |||
145 | /** |
||
146 | * Restore company from given file |
||
147 | * |
||
148 | * @param string $filename |
||
149 | * |
||
150 | * @return boolean result |
||
151 | */ |
||
152 | public function restoreBackupFrom($filename) |
||
162 | |||
163 | /** |
||
164 | * Create new company |
||
165 | * |
||
166 | * @param string $name |
||
167 | * |
||
168 | * @return boolean |
||
169 | */ |
||
170 | public function createNew($name) |
||
175 | } |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.