@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function createEveApiMessage($messagePrefix, EveApiReadWriteInterface $data) |
51 | 51 | { |
52 | - $mess = $messagePrefix . ' Eve API %1$s/%2$s'; |
|
52 | + $mess = $messagePrefix.' Eve API %1$s/%2$s'; |
|
53 | 53 | $subs = [lcfirst($data->getEveApiSectionName()), $data->getEveApiName()]; |
54 | 54 | if ($data->hasEveApiArgument('keyID')) { |
55 | 55 | $mess .= ' for keyID = %3$s'; |
@@ -130,7 +130,7 @@ |
||
130 | 130 | * @param array $columnDefaults |
131 | 131 | * @param \SimpleXMLElement[] $rows |
132 | 132 | * |
133 | - * @return array |
|
133 | + * @return string[] |
|
134 | 134 | */ |
135 | 135 | protected function processXmlRows(array $columnDefaults, array $rows) |
136 | 136 | { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess); |
170 | 170 | $mess = implode(',', $columns); |
171 | 171 | if (512 < strlen($mess)) { |
172 | - $mess = substr($mess, 0, 512) . '...'; |
|
172 | + $mess = substr($mess, 0, 512).'...'; |
|
173 | 173 | } |
174 | 174 | $this->getYem() |
175 | 175 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $mess); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | $required = array_reduce($columnDefaults, |
229 | - function ($carry, $item) { |
|
229 | + function($carry, $item) { |
|
230 | 230 | return $carry + (int)(null === $item); |
231 | 231 | }, |
232 | 232 | 0); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | return $this; |
235 | 235 | } |
236 | 236 | uksort($columnDefaults, |
237 | - function ($alpha, $beta) { |
|
237 | + function($alpha, $beta) { |
|
238 | 238 | $alpha = strtolower($alpha); |
239 | 239 | $beta = strtolower($beta); |
240 | 240 | if ($alpha < $beta) { |
@@ -372,7 +372,7 @@ |
||
372 | 372 | } |
373 | 373 | /** |
374 | 374 | * @param string $tableName |
375 | - * @param array $columnNameList |
|
375 | + * @param string[] $columnNameList |
|
376 | 376 | * @param string $rowCount |
377 | 377 | * |
378 | 378 | * @return string |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * Contains CommonSqlQueries class. |
5 | 5 | * |
@@ -381,11 +381,11 @@ discard block |
||
381 | 381 | public function getUpsert($tableName, array $columnNameList, $rowCount) |
382 | 382 | { |
383 | 383 | $columns = implode('","', $columnNameList); |
384 | - $rowPrototype = '(' . implode(',', array_fill(0, count($columnNameList), '?')) . ')'; |
|
384 | + $rowPrototype = '('.implode(',', array_fill(0, count($columnNameList), '?')).')'; |
|
385 | 385 | $rows = implode(',', array_fill(0, $rowCount, $rowPrototype)); |
386 | 386 | $updates = []; |
387 | 387 | foreach ($columnNameList as $column) { |
388 | - $updates[] = '"' . $column . '"=VALUES("' . $column . '")'; |
|
388 | + $updates[] = '"'.$column.'"=VALUES("'.$column.'")'; |
|
389 | 389 | } |
390 | 390 | $updates = implode(',', $updates); |
391 | 391 | $sql = sprintf( |
@@ -154,18 +154,18 @@ |
||
154 | 154 | } |
155 | 155 | $name = strtolower($name); |
156 | 156 | foreach ([ |
157 | - 'descr' => 'xs:string', |
|
158 | - 'name' => 'eveNameType', |
|
159 | - 'balance' => 'eveISKType', |
|
160 | - 'isk' => 'eveISKType', |
|
161 | - 'tax' => 'eveISKType', |
|
162 | - 'timeefficiency' => 'xs:unsignedByte', |
|
163 | - 'date' => 'eveNEDTType', |
|
164 | - 'time' => 'eveNEDTType', |
|
165 | - 'until' => 'eveNEDTType', |
|
166 | - 'errorcode' => 'xs:unsignedShort', |
|
167 | - 'level' => 'xs:unsignedShort' |
|
168 | - ] as $search => $replace) { |
|
157 | + 'descr' => 'xs:string', |
|
158 | + 'name' => 'eveNameType', |
|
159 | + 'balance' => 'eveISKType', |
|
160 | + 'isk' => 'eveISKType', |
|
161 | + 'tax' => 'eveISKType', |
|
162 | + 'timeefficiency' => 'xs:unsignedByte', |
|
163 | + 'date' => 'eveNEDTType', |
|
164 | + 'time' => 'eveNEDTType', |
|
165 | + 'until' => 'eveNEDTType', |
|
166 | + 'errorcode' => 'xs:unsignedShort', |
|
167 | + 'level' => 'xs:unsignedShort' |
|
168 | + ] as $search => $replace) { |
|
169 | 169 | if (false !== strpos($name, $search)) { |
170 | 170 | return $replace; |
171 | 171 | } |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | 'className' => lcfirst($data->getEveApiName()), |
100 | 100 | 'tables' => $this->tables, |
101 | 101 | 'sectionName' => lcfirst($this->sectionName), |
102 | - 'version' => gmdate('YmdHis', $sec) . sprintf('.%0-3s', floor($mSec * 1000)) |
|
102 | + 'version' => gmdate('YmdHis', $sec).sprintf('.%0-3s', floor($mSec * 1000)) |
|
103 | 103 | ]; |
104 | 104 | $templateName = $this->getTemplateName('xsd', |
105 | 105 | ucfirst($this->sectionName), |
106 | 106 | $data->getEveApiName()); |
107 | 107 | if (false === $templateName) { |
108 | - $mess ='Failed to find usable xsd template file during'; |
|
108 | + $mess = 'Failed to find usable xsd template file during'; |
|
109 | 109 | $yem->triggerLogEvent('Yapeal.Log.log', |
110 | 110 | Logger::WARNING, |
111 | 111 | $this->createEventMessage($mess, $data, $eventName)); |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | $columns[$colName] = $this->inferTypeFromName($colName); |
194 | 194 | } |
195 | 195 | uksort($columns, |
196 | - function ($alpha, $beta) { |
|
196 | + function($alpha, $beta) { |
|
197 | 197 | return strtolower($alpha) <=> strtolower($beta); |
198 | 198 | }); |
199 | 199 | $tables[$tableName] = ['attributes' => $columns]; |
200 | 200 | } |
201 | 201 | uksort($tables, |
202 | - function ($alpha, $beta) { |
|
202 | + function($alpha, $beta) { |
|
203 | 203 | return strtolower($alpha) <=> strtolower($beta); |
204 | 204 | }); |
205 | 205 | $this->tables = array_merge($this->tables, $tables); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $columns[$name] = $this->inferTypeFromName($name, true); |
229 | 229 | } |
230 | 230 | uksort($columns, |
231 | - function ($alpha, $beta) { |
|
231 | + function($alpha, $beta) { |
|
232 | 232 | return strtolower($alpha) <=> strtolower($beta); |
233 | 233 | }); |
234 | 234 | $this->tables[$tableName] = ['values' => $columns]; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, $this->createEveApiMessage($mess, $data)); |
182 | 182 | return false; |
183 | 183 | } |
184 | - if (strtotime($expires[0]['expires'] . '+00:00') < time()) { |
|
184 | + if (strtotime($expires[0]['expires'].'+00:00') < time()) { |
|
185 | 185 | $mess = 'Expired UtilCachedUntil record found for'; |
186 | 186 | $this->getYem() |
187 | 187 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $this->createEveApiMessage($mess, $data)); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if ('' === $currentTime) { |
289 | 289 | return $this; |
290 | 290 | } |
291 | - $dateTime = gmdate('Y-m-d H:i:s', strtotime($currentTime . '+00:00') + $data->getCacheInterval()); |
|
291 | + $dateTime = gmdate('Y-m-d H:i:s', strtotime($currentTime.'+00:00') + $data->getCacheInterval()); |
|
292 | 292 | $row = [ |
293 | 293 | 'accountKey' => $data->hasEveApiArgument('accountKey') ? $data->getEveApiArgument('accountKey') : '0', |
294 | 294 | 'apiName' => $data->getEveApiName(), |
@@ -166,16 +166,16 @@ |
||
166 | 166 | $name = strtolower($name); |
167 | 167 | $column = 'null'; |
168 | 168 | foreach ([ |
169 | - 'descr' => '\'\'', |
|
170 | - 'name' => '\'\'', |
|
171 | - 'balance' => '\'0.0\'', |
|
172 | - 'isk' => '\'0.0\'', |
|
173 | - 'tax' => '\'0.0\'', |
|
174 | - 'timeefficiency' => 'null', |
|
175 | - 'date' => '\'1970-01-01 00:00:01\'', |
|
176 | - 'time' => '\'1970-01-01 00:00:01\'', |
|
177 | - 'until' => '\'1970-01-01 00:00:01\'' |
|
178 | - ] as $search => $replace) { |
|
169 | + 'descr' => '\'\'', |
|
170 | + 'name' => '\'\'', |
|
171 | + 'balance' => '\'0.0\'', |
|
172 | + 'isk' => '\'0.0\'', |
|
173 | + 'tax' => '\'0.0\'', |
|
174 | + 'timeefficiency' => 'null', |
|
175 | + 'date' => '\'1970-01-01 00:00:01\'', |
|
176 | + 'time' => '\'1970-01-01 00:00:01\'', |
|
177 | + 'until' => '\'1970-01-01 00:00:01\'' |
|
178 | + ] as $search => $replace) { |
|
179 | 179 | if (false !== strpos($name, $search)) { |
180 | 180 | return $replace; |
181 | 181 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $attributes['ownerID'] = '$ownerID'; |
164 | 164 | } |
165 | 165 | uksort($attributes, |
166 | - function ($alpha, $beta) { |
|
166 | + function($alpha, $beta) { |
|
167 | 167 | return strtolower($alpha) <=> strtolower($beta); |
168 | 168 | }); |
169 | 169 | if (0 === count($this->tables)) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $values['ownerID'] = '$ownerID'; |
200 | 200 | } |
201 | 201 | uksort($values, |
202 | - function ($alpha, $beta) { |
|
202 | + function($alpha, $beta) { |
|
203 | 203 | return strtolower($alpha) <=> strtolower($beta); |
204 | 204 | }); |
205 | 205 | $this->tables[$tableName] = ['values' => $values]; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | private function getNamespace(): string |
211 | 211 | { |
212 | - return 'Yapeal\EveApi\\' . ucfirst($this->sectionName); |
|
212 | + return 'Yapeal\EveApi\\'.ucfirst($this->sectionName); |
|
213 | 213 | } |
214 | 214 | /** |
215 | 215 | * Used to determine if API is in section that has an owner. |
@@ -228,24 +228,24 @@ |
||
228 | 228 | } |
229 | 229 | $name = strtolower($name); |
230 | 230 | foreach ([ |
231 | - 'descr' => 'TEXT NOT NULL', |
|
232 | - 'name' => 'CHAR(100) NOT NULL', |
|
233 | - 'balance' => 'DECIMAL(17, 2) NOT NULL', |
|
234 | - 'isk' => 'DECIMAL(17, 2) NOT NULL', |
|
235 | - 'tax' => 'DECIMAL(17, 2) NOT NULL', |
|
236 | - 'timeefficiency' => 'TINYINT(3) UNSIGNED NOT NULL', |
|
237 | - 'date' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
238 | - 'time' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
239 | - 'until' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
240 | - 'errorcode' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
241 | - 'level' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
242 | - 'logoncount' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
243 | - 'logonminutes' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
244 | - 'trainingend' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
245 | - 'skillintraining' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
246 | - 'trainingdestinationsp' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
247 | - 'trainingstartsp' => 'BIGINT(20) UNSIGNED NOT NULL' |
|
248 | - ] as $search => $replace) { |
|
231 | + 'descr' => 'TEXT NOT NULL', |
|
232 | + 'name' => 'CHAR(100) NOT NULL', |
|
233 | + 'balance' => 'DECIMAL(17, 2) NOT NULL', |
|
234 | + 'isk' => 'DECIMAL(17, 2) NOT NULL', |
|
235 | + 'tax' => 'DECIMAL(17, 2) NOT NULL', |
|
236 | + 'timeefficiency' => 'TINYINT(3) UNSIGNED NOT NULL', |
|
237 | + 'date' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
238 | + 'time' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
239 | + 'until' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
240 | + 'errorcode' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
241 | + 'level' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
242 | + 'logoncount' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
243 | + 'logonminutes' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
244 | + 'trainingend' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
245 | + 'skillintraining' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
246 | + 'trainingdestinationsp' => 'BIGINT(20) UNSIGNED NOT NULL', |
|
247 | + 'trainingstartsp' => 'BIGINT(20) UNSIGNED NOT NULL' |
|
248 | + ] as $search => $replace) { |
|
249 | 249 | if (false !== strpos($name, $search)) { |
250 | 250 | return $replace; |
251 | 251 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'className' => lcfirst($this->apiName), |
106 | 106 | 'tables' => $this->tables, |
107 | 107 | 'sectionName' => lcfirst($this->sectionName), |
108 | - 'version' => gmdate('YmdHis', $sec) . substr($mSec, 1, 4) |
|
108 | + 'version' => gmdate('YmdHis', $sec).substr($mSec, 1, 4) |
|
109 | 109 | ]; |
110 | 110 | $templateName = $this->getTemplateName($this->getPlatform(), |
111 | 111 | ucfirst($this->sectionName), |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $columns['ownerID'] = 'BIGINT(20) UNSIGNED NOT NULL'; |
172 | 172 | } |
173 | 173 | uksort($columns, |
174 | - function ($alpha, $beta) { |
|
174 | + function($alpha, $beta) { |
|
175 | 175 | return strtolower($alpha) <=> strtolower($beta); |
176 | 176 | }); |
177 | 177 | if (0 === count($this->tables)) { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $columns['ownerID'] = 'BIGINT(20) UNSIGNED NOT NULL'; |
205 | 205 | } |
206 | 206 | uksort($columns, |
207 | - function ($alpha, $beta) { |
|
207 | + function($alpha, $beta) { |
|
208 | 208 | return strtolower($alpha) <=> strtolower($beta); |
209 | 209 | }); |
210 | 210 | $keys = $this->getSqlKeys(); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | public function wire(ContainerInterface $dic) |
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Xsl.Transformer'])) { |
53 | - $dic['Yapeal.Xsl.Transformer'] = function () use ($dic) { |
|
53 | + $dic['Yapeal.Xsl.Transformer'] = function() use ($dic) { |
|
54 | 54 | return new $dic['Yapeal.Xsl.transform']($dic['Yapeal.Xsl.dir']); |
55 | 55 | }; |
56 | 56 | } |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | public function wire(ContainerInterface $dic) |
50 | 50 | { |
51 | 51 | if (empty($dic['Yapeal.Log.Strategy'])) { |
52 | - $dic['Yapeal.Log.Strategy'] = function () use ($dic) { |
|
52 | + $dic['Yapeal.Log.Strategy'] = function() use ($dic) { |
|
53 | 53 | return new $dic['Yapeal.Log.Handlers.strategy']((int)$dic['Yapeal.Log.threshold']); |
54 | 54 | }; |
55 | 55 | } |
56 | 56 | if (empty($dic['Yapeal.Log.Logger'])) { |
57 | - $dic['Yapeal.Log.Logger'] = function () use ($dic) { |
|
57 | + $dic['Yapeal.Log.Logger'] = function() use ($dic) { |
|
58 | 58 | $group = []; |
59 | 59 | $lineFormatter = new LineFormatter(null, 'Ymd His.u', true, true); |
60 | 60 | $lineFormatter->includeStacktraces(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $handler->setFormatter($lineFormatter); |
67 | 67 | $group[] = $handler; |
68 | 68 | } |
69 | - $handler = new $dic['Yapeal.Log.Handlers.stream']($dic['Yapeal.Log.dir'] . $dic['Yapeal.Log.fileName'], |
|
69 | + $handler = new $dic['Yapeal.Log.Handlers.stream']($dic['Yapeal.Log.dir'].$dic['Yapeal.Log.fileName'], |
|
70 | 70 | 100); |
71 | 71 | $group[] = $handler->setFormatter($lineFormatter); |
72 | 72 | return new $dic['Yapeal.Log.Handlers.class']($dic['Yapeal.Log.channel'], [ |