@@ -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'; |
@@ -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); |
@@ -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 | { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (PREG_NO_ERROR !== $lastError) { |
182 | 182 | $constants = array_flip(get_defined_constants(true)['pcre']); |
183 | 183 | $lastError = $constants[$lastError]; |
184 | - $mess = 'Received preg error ' . $lastError; |
|
184 | + $mess = 'Received preg error '.$lastError; |
|
185 | 185 | throw new \DomainException($mess); |
186 | 186 | } |
187 | 187 | $this->getYem() |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | } |
247 | 247 | $required = array_reduce($columnDefaults, |
248 | - function ($carry, $item) { |
|
248 | + function($carry, $item) { |
|
249 | 249 | return $carry + (int)(null === $item); |
250 | 250 | }, |
251 | 251 | 0); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | return $this; |
254 | 254 | } |
255 | 255 | uksort($columnDefaults, |
256 | - function ($alpha, $beta) { |
|
256 | + function($alpha, $beta) { |
|
257 | 257 | return strtolower($alpha) <=> strtolower($beta); |
258 | 258 | }); |
259 | 259 | return $this->flush(array_values($columnDefaults), array_keys($columnDefaults), $tableName); |
@@ -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(), |
@@ -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 | } |
@@ -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 | */ |
@@ -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'], [ |
@@ -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); |