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 | * Class for read only interaction with FlexiBee. |
||
54 | * |
||
55 | * @param string|array $init company dbNazev or initial data |
||
56 | * @param array $options Connection settings override |
||
57 | */ |
||
58 | public function __construct($init = null, $options = []) |
||
65 | |||
66 | 1 | /** |
|
67 | 1 | * Zinicializuje objekt dle daných dat. Možné hodnoty: |
|
68 | 1 | * |
|
69 | 1 | * * ['dbNazev'=>'company'] - load company form FlexiBee |
|
70 | 1 | * * 234 - interní číslo záznamu k načtení |
|
71 | 1 | * * code:LOPATA - kód záznamu |
|
72 | 1 | * * BAGR - kód záznamu k načtení |
|
73 | 1 | * * ['id'=>24,'nazev'=>'hoblík'] - pole hodnot k předvyplnění |
|
74 | * * 743.json?relations=adresa,vazby - část url s parametry k načtení |
||
75 | * |
||
76 | * @param mixed $init číslo/"(code:)kód"/(část)URI záznamu k načtení | pole hodnot k předvyplnění |
||
77 | */ |
||
78 | public function processInit($init) |
||
89 | |||
90 | /** |
||
91 | 2 | * Vrací základní URL pro užitou evidenci |
|
92 | * |
||
93 | * @link https://www.flexibee.eu/api/dokumentace/ref/urls/ Sestavování URL |
||
94 | * @param string $urlSuffix |
||
95 | */ |
||
96 | public function getEvidenceURL($urlSuffix = null) |
||
108 | |||
109 | /** |
||
110 | * Vrací název evidence použité v odpovědích z FlexiBee |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getResponseEvidence() |
||
118 | |||
119 | /** |
||
120 | * Parse Raw FlexiBee response in several formats |
||
121 | * |
||
122 | * @param string $responseRaw raw response body |
||
123 | * @param string $format Raw Response format json|xml|etc |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | public function rawResponseToArray($responseRaw, $format) |
||
139 | |||
140 | /** |
||
141 | * Save company backup to file |
||
142 | * |
||
143 | * @param string $filename |
||
144 | * |
||
145 | * @return boolean was backup saved to file ? |
||
146 | */ |
||
147 | public function saveBackupTo($filename) |
||
163 | |||
164 | /** |
||
165 | * Restore company from given file |
||
166 | * |
||
167 | * @param string $filename |
||
168 | * |
||
169 | * @return boolean result |
||
170 | */ |
||
171 | public function restoreBackupFrom($filename) |
||
181 | |||
182 | /** |
||
183 | * Create new company |
||
184 | * |
||
185 | 3 | * @param string $name |
|
186 | * |
||
187 | 3 | * @return boolean |
|
188 | */ |
||
189 | public function createNew($name) |
||
194 | |||
195 | /** |
||
196 | * Obtain company identifier |
||
197 | * |
||
198 | * @return string company database name |
||
199 | */ |
||
200 | public function getRecordID() |
||
204 | |||
205 | /** |
||
206 | * Company has no relations |
||
207 | * |
||
208 | * @return null |
||
209 | */ |
||
210 | public function getVazby($id = null) |
||
214 | } |
||
215 |
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.