@@ -103,10 +103,10 @@ |
||
103 | 103 | public function setCachePath($value = null) |
104 | 104 | { |
105 | 105 | if ($value === null) { |
106 | - $value = dirname(dirname(__DIR__)) . '/cache/'; |
|
106 | + $value = dirname(dirname(__DIR__)).'/cache/'; |
|
107 | 107 | } |
108 | 108 | if (!is_string($value)) { |
109 | - $mess = 'Cache path MUST be string, but was given ' . gettype($value); |
|
109 | + $mess = 'Cache path MUST be string, but was given '.gettype($value); |
|
110 | 110 | throw new InvalidArgumentException($mess); |
111 | 111 | } |
112 | 112 | if ('' === $this->cachePath) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | if ($code < 200) { |
82 | 82 | if (false !== strpos($mess, 'retry after')) { |
83 | - $data->setCacheInterval(strtotime(substr($mess, -19) . '+00:00') - time()); |
|
83 | + $data->setCacheInterval(strtotime(substr($mess, -19).'+00:00') - time()); |
|
84 | 84 | } |
85 | 85 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, |
86 | 86 | $this->createEventMessage($mess, $data, $eventName)); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $data->setCacheInterval(300); |
98 | 98 | } |
99 | 99 | $apiName = $data->getEveApiName(); |
100 | - $data->setEveApiName('Error_' . $apiName); |
|
100 | + $data->setEveApiName('Error_'.$apiName); |
|
101 | 101 | // Cache error XML. |
102 | 102 | $this->emitEvents($data, 'cache'); |
103 | 103 | $data->setEveApiName($apiName); |
@@ -50,12 +50,12 @@ |
||
50 | 50 | public function wire(ContainerInterface $dic) |
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Error.Strategy'])) { |
53 | - $dic['Yapeal.Error.Strategy'] = function () use ($dic) { |
|
53 | + $dic['Yapeal.Error.Strategy'] = function() use ($dic) { |
|
54 | 54 | return new $dic['Yapeal.Error.Handlers.strategy']((int)$dic['Yapeal.Error.threshold']); |
55 | 55 | }; |
56 | 56 | } |
57 | 57 | if (empty($dic['Yapeal.Error.Logger'])) { |
58 | - $dic['Yapeal.Error.Logger'] = function () use ($dic) { |
|
58 | + $dic['Yapeal.Error.Logger'] = function() use ($dic) { |
|
59 | 59 | /** |
60 | 60 | * @var Logger $logger |
61 | 61 | */ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function __construct($dir = __DIR__) |
55 | 55 | { |
56 | - $this->setRelativeBaseDir($dir . '/'); |
|
56 | + $this->setRelativeBaseDir($dir.'/'); |
|
57 | 57 | } |
58 | 58 | /** |
59 | 59 | * @param EveApiEventInterface $event |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | $arguments = $data->getEveApiArguments(); |
112 | 112 | if (!empty($arguments['vCode'])) { |
113 | - $arguments['vCode'] = substr($arguments['vCode'], 0, 8) . '...'; |
|
113 | + $arguments['vCode'] = substr($arguments['vCode'], 0, 8).'...'; |
|
114 | 114 | } |
115 | 115 | if (!in_array($data->getEveApiName(), ['accountBalance', 'walletJournal', 'walletTransactions'], true)) { |
116 | 116 | unset($arguments['accountKey']); |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | $json = json_encode($arguments); |
121 | 121 | $xml = str_replace(["encoding='UTF-8'?>\r\n<eveapi", "encoding='UTF-8'?>\n<eveapi"], |
122 | 122 | [ |
123 | - "encoding='UTF-8'?>\r\n<?yapeal.parameters.json " . $json . "?>\r\n<eveapi", |
|
124 | - "encoding='UTF-8'?>\n<?yapeal.parameters.json " . $json . "?>\n<eveapi" |
|
123 | + "encoding='UTF-8'?>\r\n<?yapeal.parameters.json ".$json."?>\r\n<eveapi", |
|
124 | + "encoding='UTF-8'?>\n<?yapeal.parameters.json ".$json."?>\n<eveapi" |
|
125 | 125 | ], |
126 | 126 | $xml); |
127 | 127 | $data->setEveApiXml($xml); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | $apiName = $data->getEveApiName(); |
171 | - $data->setEveApiName('Untransformed_' . $apiName); |
|
171 | + $data->setEveApiName('Untransformed_'.$apiName); |
|
172 | 172 | // Cache error causing XML. |
173 | 173 | $this->emitEvents($data, 'preserve', 'Yapeal.Xml.Error'); |
174 | 174 | $data->setEveApiName($apiName); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'className' => lcfirst($data->getEveApiName()), |
96 | 96 | 'tables' => $this->tables, |
97 | 97 | 'sectionName' => lcfirst($this->sectionName), |
98 | - 'version' => gmdate('YmdHis', $sec) . sprintf('.%0-3s', floor($mSec * 1000)) |
|
98 | + 'version' => gmdate('YmdHis', $sec).sprintf('.%0-3s', floor($mSec * 1000)) |
|
99 | 99 | ]; |
100 | 100 | try { |
101 | 101 | $contents = $this->getTwig() |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $columns[$colName] = $this->inferTypeFromName($colName); |
183 | 183 | } |
184 | 184 | uksort($columns, |
185 | - function ($alpha, $beta) { |
|
185 | + function($alpha, $beta) { |
|
186 | 186 | $alpha = strtolower($alpha); |
187 | 187 | $beta = strtolower($beta); |
188 | 188 | if ($alpha < $beta) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $tables[$tableName] = ['attributes' => $columns]; |
196 | 196 | } |
197 | 197 | uksort($tables, |
198 | - function ($alpha, $beta) { |
|
198 | + function($alpha, $beta) { |
|
199 | 199 | $alpha = strtolower($alpha); |
200 | 200 | $beta = strtolower($beta); |
201 | 201 | if ($alpha < $beta) { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $columns[$name] = $this->inferTypeFromName($name, true); |
232 | 232 | } |
233 | 233 | uksort($columns, |
234 | - function ($alpha, $beta) { |
|
234 | + function($alpha, $beta) { |
|
235 | 235 | $alpha = strtolower($alpha); |
236 | 236 | $beta = strtolower($beta); |
237 | 237 | if ($alpha < $beta) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function __construct($dir = __DIR__) |
54 | 54 | { |
55 | - $this->setRelativeBaseDir($dir . '/'); |
|
55 | + $this->setRelativeBaseDir($dir.'/'); |
|
56 | 56 | } |
57 | 57 | /** |
58 | 58 | * @param EveApiEventInterface $event |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $mess = 'Received HTML result from '; |
77 | 77 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $this->createEveApiMessage($mess, $data)); |
78 | 78 | $apiName = $data->getEveApiName(); |
79 | - $data->setEveApiName('Invalid_' . $apiName); |
|
79 | + $data->setEveApiName('Invalid_'.$apiName); |
|
80 | 80 | // Cache error html. |
81 | 81 | $this->emitEvents($data, 'preserve', 'Yapeal.Xml.Error'); |
82 | 82 | $data->setEveApiName($apiName); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | libxml_use_internal_errors(false); |
107 | 107 | libxml_clear_errors(); |
108 | 108 | $apiName = $data->getEveApiName(); |
109 | - $data->setEveApiName('Invalid_' . $apiName); |
|
109 | + $data->setEveApiName('Invalid_'.$apiName); |
|
110 | 110 | // Cache error causing XML. |
111 | 111 | $this->emitEvents($data, 'preserve', 'Yapeal.Xml.Error'); |
112 | 112 | $data->setEveApiName($apiName); |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | public function setCachePath($value = null) |
104 | 104 | { |
105 | 105 | if ($value === null) { |
106 | - $value = dirname(dirname(__DIR__)) . '/cache/'; |
|
106 | + $value = dirname(dirname(__DIR__)).'/cache/'; |
|
107 | 107 | } |
108 | 108 | if (!is_string($value)) { |
109 | - $mess = 'Cache path MUST be string, but was given ' . gettype($value); |
|
109 | + $mess = 'Cache path MUST be string, but was given '.gettype($value); |
|
110 | 110 | throw new \InvalidArgumentException($mess); |
111 | 111 | } |
112 | 112 | $this->cachePath = $this->getFpn() |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | return true; |
170 | 170 | } |
171 | 171 | $now = time(); |
172 | - $current = strtotime($current . '+00:00'); |
|
173 | - $until = strtotime($until . '+00:00'); |
|
172 | + $current = strtotime($current.'+00:00'); |
|
173 | + $until = strtotime($until.'+00:00'); |
|
174 | 174 | // At minimum use cached XML for 5 minutes (300 secs). |
175 | 175 | if (($now - $current) <= 300) { |
176 | 176 | return false; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | protected function getUpdateFileList(OutputInterface $output) |
152 | 152 | { |
153 | 153 | $fileNames = []; |
154 | - $path = $this->getDic()['Yapeal.Sql.dir'] . 'updates/'; |
|
154 | + $path = $this->getDic()['Yapeal.Sql.dir'].'updates/'; |
|
155 | 155 | if (!is_readable($path) || !is_dir($path)) { |
156 | 156 | $mess = sprintf('<info>Could NOT access update directory %1$s</info>', |
157 | 157 | $path); |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | ->execute([$updateVersion]); |
235 | 235 | $pdo->commit(); |
236 | 236 | } catch (\PDOException $exc) { |
237 | - $mess = $sql . PHP_EOL; |
|
238 | - $mess .= sprintf('Database error message was %s', $exc->getMessage()) . PHP_EOL; |
|
237 | + $mess = $sql.PHP_EOL; |
|
238 | + $mess .= sprintf('Database error message was %s', $exc->getMessage()).PHP_EOL; |
|
239 | 239 | $mess .= sprintf('Database "version" update failed for %1$s', |
240 | 240 | $updateVersion); |
241 | 241 | if ($this->getPdo() |
@@ -83,7 +83,7 @@ |
||
83 | 83 | * @param \Yapeal\Xml\EveApiReadWriteInterface $data |
84 | 84 | * @param array $context |
85 | 85 | * |
86 | - * @return bool|string |
|
86 | + * @return false|string |
|
87 | 87 | * @throws \DomainException |
88 | 88 | * @throws \InvalidArgumentException |
89 | 89 | * @throws \LogicException |