@@ -111,7 +111,7 @@ |
||
111 | 111 | } |
112 | 112 | $fileList = []; |
113 | 113 | foreach ($sections as $dir) { |
114 | - foreach (new DirectoryIterator($path . $dir . '/') as $fileInfo) { |
|
114 | + foreach (new DirectoryIterator($path.$dir.'/') as $fileInfo) { |
|
115 | 115 | if (!$fileInfo->isFile() |
116 | 116 | || 'sql' !== $fileInfo->getExtension() |
117 | 117 | || 'Create' !== substr($fileInfo->getBasename(), 0, 6) |
@@ -118,7 +118,7 @@ |
||
118 | 118 | continue; |
119 | 119 | } |
120 | 120 | $fileList[] = $this->getFpn() |
121 | - ->normalizeFile($fileInfo->getPathname()); |
|
121 | + ->normalizeFile($fileInfo->getPathname()); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | $fileNames = '%1$sCreateCustomTables.sql,%2$sconfig/CreateCustomTables.sql'; |
@@ -52,8 +52,8 @@ |
||
52 | 52 | array $context = [] |
53 | 53 | ) { |
54 | 54 | $this->setLevel($level) |
55 | - ->setMessage($message) |
|
56 | - ->setContext($context); |
|
55 | + ->setMessage($message) |
|
56 | + ->setContext($context); |
|
57 | 57 | } |
58 | 58 | /** |
59 | 59 | * @return array |
@@ -86,8 +86,8 @@ |
||
86 | 86 | $event = new LogEvent(); |
87 | 87 | } |
88 | 88 | $event->setLevel($level) |
89 | - ->setMessage($message) |
|
90 | - ->setContext($context); |
|
89 | + ->setMessage($message) |
|
90 | + ->setContext($context); |
|
91 | 91 | return $this->trigger($eventName, $event); |
92 | 92 | } |
93 | 93 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $mess = 'Could NOT get a list of active corporations'; |
59 | 59 | $this->getYem() |
60 | 60 | ->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, $mess); |
61 | - $mess = 'Database error message was ' . $exc->getMessage(); |
|
61 | + $mess = 'Database error message was '.$exc->getMessage(); |
|
62 | 62 | $this->getYem() |
63 | 63 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $mess); |
64 | 64 | return []; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | ->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, $this->createEveApiMessage($mess, $data)); |
174 | 174 | return false; |
175 | 175 | } |
176 | - if (strtotime($expires[0]['expires'] . '+00:00') < time()) { |
|
176 | + if (strtotime($expires[0]['expires'].'+00:00') < time()) { |
|
177 | 177 | $mess = 'Expired UtilCachedUntil record found for'; |
178 | 178 | $this->getYem() |
179 | 179 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $this->createEveApiMessage($mess, $data)); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | /** @noinspection PhpUndefinedFieldInspection */ |
281 | 281 | $dateTime = gmdate( |
282 | 282 | 'Y-m-d H:i:s', |
283 | - strtotime($simple->currentTime[0] . '+00:00') + $data->getCacheInterval() |
|
283 | + strtotime($simple->currentTime[0].'+00:00') + $data->getCacheInterval() |
|
284 | 284 | ); |
285 | 285 | $row = [$data->getEveApiName(), $dateTime, $ownerID, $data->getEveApiSectionName()]; |
286 | 286 | $sql = $this->getCsq() |
@@ -160,16 +160,16 @@ |
||
160 | 160 | $name = strtolower($name); |
161 | 161 | $column = 'null'; |
162 | 162 | foreach ([ |
163 | - 'descr' => '\'\'', |
|
164 | - 'name' => '\'\'', |
|
165 | - 'balance' => '\'0.0\'', |
|
166 | - 'isk' => '\'0.0\'', |
|
167 | - 'tax' => '\'0.0\'', |
|
168 | - 'timeefficiency' => 'null', |
|
169 | - 'date' => '\'1970-01-01 00:00:01\'', |
|
170 | - 'time' => '\'1970-01-01 00:00:01\'', |
|
171 | - 'until' => '\'1970-01-01 00:00:01\'' |
|
172 | - ] as $search => $replace) { |
|
163 | + 'descr' => '\'\'', |
|
164 | + 'name' => '\'\'', |
|
165 | + 'balance' => '\'0.0\'', |
|
166 | + 'isk' => '\'0.0\'', |
|
167 | + 'tax' => '\'0.0\'', |
|
168 | + 'timeefficiency' => 'null', |
|
169 | + 'date' => '\'1970-01-01 00:00:01\'', |
|
170 | + 'time' => '\'1970-01-01 00:00:01\'', |
|
171 | + 'until' => '\'1970-01-01 00:00:01\'' |
|
172 | + ] as $search => $replace) { |
|
173 | 173 | if (false !== strpos($name, $search)) { |
174 | 174 | return $replace; |
175 | 175 | } |
@@ -137,7 +137,7 @@ |
||
137 | 137 | */ |
138 | 138 | protected function getNamespace() |
139 | 139 | { |
140 | - return 'Yapeal\EveApi\\' . ucfirst($this->sectionName); |
|
140 | + return 'Yapeal\EveApi\\'.ucfirst($this->sectionName); |
|
141 | 141 | } |
142 | 142 | /** |
143 | 143 | * Used to determine if API is in section that has an owner. |
@@ -380,11 +380,11 @@ |
||
380 | 380 | public function getUpsert($tableName, array $columnNameList, $rowCount) |
381 | 381 | { |
382 | 382 | $columns = implode('","', $columnNameList); |
383 | - $rowPrototype = '(' . implode(',', array_fill(0, count($columnNameList), '?')) . ')'; |
|
383 | + $rowPrototype = '('.implode(',', array_fill(0, count($columnNameList), '?')).')'; |
|
384 | 384 | $rows = implode(',', array_fill(0, $rowCount, $rowPrototype)); |
385 | 385 | $updates = []; |
386 | 386 | foreach ($columnNameList as $column) { |
387 | - $updates[] = '"' . $column . '"=VALUES("' . $column . '")'; |
|
387 | + $updates[] = '"'.$column.'"=VALUES("'.$column.'")'; |
|
388 | 388 | } |
389 | 389 | $updates = implode(',', $updates); |
390 | 390 | $sql = sprintf( |
@@ -238,18 +238,18 @@ |
||
238 | 238 | } |
239 | 239 | $name = strtolower($name); |
240 | 240 | foreach ([ |
241 | - 'descr' => 'TEXT NOT NULL', |
|
242 | - 'name' => 'CHAR(100) NOT NULL', |
|
243 | - 'balance' => 'DECIMAL(17, 2) NOT NULL', |
|
244 | - 'isk' => 'DECIMAL(17, 2) NOT NULL', |
|
245 | - 'tax' => 'DECIMAL(17, 2) NOT NULL', |
|
246 | - 'timeefficiency' => 'TINYINT(3) UNSIGNED NOT NULL', |
|
247 | - 'date' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
248 | - 'time' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
249 | - 'until' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
250 | - 'errorcode' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
251 | - 'level' => 'SMALLINT(4) UNSIGNED NOT NULL' |
|
252 | - ] as $search => $replace) { |
|
241 | + 'descr' => 'TEXT NOT NULL', |
|
242 | + 'name' => 'CHAR(100) NOT NULL', |
|
243 | + 'balance' => 'DECIMAL(17, 2) NOT NULL', |
|
244 | + 'isk' => 'DECIMAL(17, 2) NOT NULL', |
|
245 | + 'tax' => 'DECIMAL(17, 2) NOT NULL', |
|
246 | + 'timeefficiency' => 'TINYINT(3) UNSIGNED NOT NULL', |
|
247 | + 'date' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
248 | + 'time' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
249 | + 'until' => 'DATETIME NOT NULL DEFAULT \'1970-01-01 00:00:01\'', |
|
250 | + 'errorcode' => 'SMALLINT(4) UNSIGNED NOT NULL', |
|
251 | + 'level' => 'SMALLINT(4) UNSIGNED NOT NULL' |
|
252 | + ] as $search => $replace) { |
|
253 | 253 | if (false !== strpos($name, $search)) { |
254 | 254 | return $replace; |
255 | 255 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | 'className' => lcfirst($this->apiName), |
119 | 119 | 'tables' => $this->tables, |
120 | 120 | 'sectionName' => lcfirst($this->sectionName), |
121 | - 'version' => gmdate('YmdHis', $sec) . sprintf('.%0-3s', floor($mSec * 1000)) |
|
121 | + 'version' => gmdate('YmdHis', $sec).sprintf('.%0-3s', floor($mSec * 1000)) |
|
122 | 122 | ]; |
123 | 123 | // Add create or replace view. |
124 | 124 | if (!in_array(strtolower($this->apiName), array_map('strtolower', $tableNames), true)) { |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $names = explode( |
195 | 195 | ',', |
196 | 196 | sprintf( |
197 | - '%1$s/%2$s.%3$s.%4$s,%1$s/%2$s.%4$s,%1$s/%3$s.%4$s,' . '%2$s.%3$s.%4$s,%2$s.%4$s,%3$s.%4$s,sql.%4$s', |
|
197 | + '%1$s/%2$s.%3$s.%4$s,%1$s/%2$s.%4$s,%1$s/%3$s.%4$s,'.'%2$s.%3$s.%4$s,%2$s.%4$s,%3$s.%4$s,sql.%4$s', |
|
198 | 198 | ucfirst($data->getEveApiSectionName()), |
199 | 199 | $data->getEveApiName(), |
200 | 200 | $platform, |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ) |
203 | 203 | ); |
204 | 204 | foreach ($names as $fileName) { |
205 | - if (is_file($this->getDir() . $fileName)) { |
|
205 | + if (is_file($this->getDir().$fileName)) { |
|
206 | 206 | return $fileName; |
207 | 207 | } |
208 | 208 | } |
@@ -74,28 +74,28 @@ discard block |
||
74 | 74 | } |
75 | 75 | $ownerID = $this->extractOwnerID($data->getEveApiArguments()); |
76 | 76 | $this->getYem() |
77 | - ->triggerLogEvent( |
|
78 | - 'Yapeal.Log.log', |
|
79 | - Logger::DEBUG, |
|
80 | - $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
81 | - ); |
|
77 | + ->triggerLogEvent( |
|
78 | + 'Yapeal.Log.log', |
|
79 | + Logger::DEBUG, |
|
80 | + $this->getReceivedEventMessage($data, $eventName, __CLASS__) |
|
81 | + ); |
|
82 | 82 | $this->getPdo() |
83 | - ->beginTransaction(); |
|
83 | + ->beginTransaction(); |
|
84 | 84 | try { |
85 | 85 | $this->preserveToAssetList($xml, $ownerID); |
86 | 86 | $this->getPdo() |
87 | - ->commit(); |
|
87 | + ->commit(); |
|
88 | 88 | } catch (PDOException $exc) { |
89 | 89 | $mess = 'Failed to upsert data of'; |
90 | 90 | $this->getYem() |
91 | - ->triggerLogEvent( |
|
92 | - 'Yapeal.Log.log', |
|
93 | - Logger::WARNING, |
|
94 | - $this->createEveApiMessage($mess, $data), |
|
95 | - ['exception' => $exc] |
|
96 | - ); |
|
91 | + ->triggerLogEvent( |
|
92 | + 'Yapeal.Log.log', |
|
93 | + Logger::WARNING, |
|
94 | + $this->createEveApiMessage($mess, $data), |
|
95 | + ['exception' => $exc] |
|
96 | + ); |
|
97 | 97 | $this->getPdo() |
98 | - ->rollBack(); |
|
98 | + ->rollBack(); |
|
99 | 99 | return $event; |
100 | 100 | } |
101 | 101 | return $event->setHandledSufficiently(); |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | $sql = $this->getCsq() |
114 | 114 | ->getDeleteFromTableWithOwnerID($tableName, $ownerID); |
115 | 115 | $this->getYem() |
116 | - ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql); |
|
116 | + ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql); |
|
117 | 117 | $this->getPdo() |
118 | - ->exec($sql); |
|
118 | + ->exec($sql); |
|
119 | 119 | $columnDefaults = [ |
120 | 120 | 'flag' => '0', |
121 | 121 | 'itemID' => null, |