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 | /** |
||
47 | * Key Column for this evidence |
||
48 | * @var string |
||
49 | */ |
||
50 | public $myKeyColumn = 'dbNazev'; |
||
51 | |||
52 | /** |
||
53 | * Zinicializuje objekt dle daných dat. Možné hodnoty: |
||
54 | * |
||
55 | * * ['dbNazev'=>'company'] - load company form FlexiBee |
||
56 | * * 234 - interní číslo záznamu k načtení |
||
57 | * * code:LOPATA - kód záznamu |
||
58 | * * BAGR - kód záznamu k načtení |
||
59 | * * ['id'=>24,'nazev'=>'hoblík'] - pole hodnot k předvyplnění |
||
60 | * * 743.json?relations=adresa,vazby - část url s parametry k načtení |
||
61 | * |
||
62 | * @param mixed $init číslo/"(code:)kód"/(část)URI záznamu k načtení | pole hodnot k předvyplnění |
||
63 | */ |
||
64 | 1 | public function processInit($init) |
|
74 | |||
75 | /** |
||
76 | * Vrací základní URL pro užitou evidenci |
||
77 | * |
||
78 | * @link https://www.flexibee.eu/api/dokumentace/ref/urls/ Sestavování URL |
||
79 | * @param string $urlSuffix |
||
80 | */ |
||
81 | 2 | public function getEvidenceURL($urlSuffix = null) |
|
93 | |||
94 | /** |
||
95 | * Vrací název evidence použité v odpovědích z FlexiBee |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 1 | public function getResponseEvidence() |
|
103 | |||
104 | /** |
||
105 | * Parse Raw FlexiBee response in several formats |
||
106 | * |
||
107 | * @param string $responseRaw raw response body |
||
108 | * @param string $format Raw Response format json|xml|etc |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function rawResponseToArray($responseRaw, $format) |
||
124 | |||
125 | /** |
||
126 | * Save company backup to file |
||
127 | * |
||
128 | * @param string $filename |
||
129 | * |
||
130 | * @return boolean was backup saved to file ? |
||
131 | */ |
||
132 | public function saveBackupTo($filename) |
||
148 | |||
149 | /** |
||
150 | * Restore company from given file |
||
151 | * |
||
152 | * @param string $filename |
||
153 | * |
||
154 | * @return boolean result |
||
155 | */ |
||
156 | public function restoreBackupFrom($filename) |
||
166 | |||
167 | /** |
||
168 | * Create new company |
||
169 | * |
||
170 | * @param string $name |
||
171 | * |
||
172 | * @return boolean |
||
173 | */ |
||
174 | public function createNew($name) |
||
179 | |||
180 | /** |
||
181 | * Obtain company identifier |
||
182 | * |
||
183 | * @return string company database name |
||
184 | */ |
||
185 | 3 | public function getRecordID() |
|
189 | |||
190 | /** |
||
191 | * Company has no relations |
||
192 | * |
||
193 | * @return null |
||
194 | */ |
||
195 | public function getVazby($id = null) |
||
199 | } |
||
200 |
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.