@@ -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 | { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if (PREG_NO_ERROR !== $lastError = preg_last_error()) { |
| 233 | 233 | $constants = array_flip(get_defined_constants(true)['pcre']); |
| 234 | 234 | $lastError = $constants[$lastError]; |
| 235 | - $mess = 'Received preg error ' . $lastError; |
|
| 235 | + $mess = 'Received preg error '.$lastError; |
|
| 236 | 236 | throw new \DomainException($mess); |
| 237 | 237 | } |
| 238 | 238 | $this->getYem() |
@@ -244,12 +244,12 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | $mess = ''; |
| 246 | 246 | foreach ($columns as $column) { |
| 247 | - $mess .= $column . ','; |
|
| 247 | + $mess .= $column.','; |
|
| 248 | 248 | if (256 <= strlen($mess)) { |
| 249 | 249 | break; |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | - $mess = substr($mess, 0, 256) . '...'; |
|
| 252 | + $mess = substr($mess, 0, 256).'...'; |
|
| 253 | 253 | $this->getYem() |
| 254 | 254 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $mess); |
| 255 | 255 | $this->pdoStatement->execute($columns); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | protected function processXmlRows(array $rows, array $columnDefaults): array |
| 268 | 268 | { |
| 269 | - $callback = function (array $carry, \SimpleXMLElement $row) use ($columnDefaults): array { |
|
| 269 | + $callback = function(array $carry, \SimpleXMLElement $row) use ($columnDefaults): array { |
|
| 270 | 270 | foreach ($columnDefaults as $key => $value) { |
| 271 | 271 | $attribute = (string)$row[$key]; |
| 272 | 272 | $carry[] = '' !== $attribute ? $attribute : (string)$value; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | return $this; |
| 297 | 297 | } |
| 298 | 298 | $defaultNames = array_keys($columnDefaults); |
| 299 | - $callback = function (array $carry, \SimpleXMLElement $element) use ($defaultNames): array { |
|
| 299 | + $callback = function(array $carry, \SimpleXMLElement $element) use ($defaultNames): array { |
|
| 300 | 300 | if (in_array($name = $element->getName(), $defaultNames, true)) { |
| 301 | 301 | $carry[$name] = (string)$element; |
| 302 | 302 | } |
@@ -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 | } |
@@ -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) { |
@@ -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 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $this->setRelativeBaseDir($dir); |
| 55 | 55 | $this->setPlatform($platform); |
| 56 | 56 | $this->setTwig($twig); |
| 57 | - $this->twigExtension = strtolower($platform) . '.sql.twig'; |
|
| 57 | + $this->twigExtension = strtolower($platform).'.sql.twig'; |
|
| 58 | 58 | } |
| 59 | 59 | /** |
| 60 | 60 | * @param EveApiEventInterface $event |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'className' => lcfirst($this->apiName), |
| 109 | 109 | 'tables' => $this->tables, |
| 110 | 110 | 'sectionName' => lcfirst($this->sectionName), |
| 111 | - 'version' => gmdate('YmdHis', $sec) . substr($mSec, 1, 4) |
|
| 111 | + 'version' => gmdate('YmdHis', $sec).substr($mSec, 1, 4) |
|
| 112 | 112 | ]; |
| 113 | 113 | $contents = $this->getContentsFromTwig($eventName, $data, $context); |
| 114 | 114 | if (false === $contents) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $columns['ownerID'] = 'BIGINT(20) UNSIGNED NOT NULL'; |
| 159 | 159 | } |
| 160 | 160 | uksort($columns, |
| 161 | - function ($alpha, $beta) { |
|
| 161 | + function($alpha, $beta) { |
|
| 162 | 162 | return strtolower($alpha) <=> strtolower($beta); |
| 163 | 163 | }); |
| 164 | 164 | if (0 === count($this->tables)) { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $columns['ownerID'] = 'BIGINT(20) UNSIGNED NOT NULL'; |
| 192 | 192 | } |
| 193 | 193 | uksort($columns, |
| 194 | - function ($alpha, $beta) { |
|
| 194 | + function($alpha, $beta) { |
|
| 195 | 195 | return strtolower($alpha) <=> strtolower($beta); |
| 196 | 196 | }); |
| 197 | 197 | $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,13 +49,13 @@ |
||
| 49 | 49 | public function wire(ContainerInterface $dic) |
| 50 | 50 | { |
| 51 | 51 | if (empty($dic['Yapeal.FileSystem.CachePreserver'])) { |
| 52 | - $dic['Yapeal.FileSystem.CachePreserver'] = function () use ($dic) { |
|
| 52 | + $dic['Yapeal.FileSystem.CachePreserver'] = function() use ($dic) { |
|
| 53 | 53 | return new $dic['Yapeal.FileSystem.Handlers.preserve']($dic['Yapeal.FileSystem.Cache.dir'], |
| 54 | 54 | $dic['Yapeal.FileSystem.Cache.preserve']); |
| 55 | 55 | }; |
| 56 | 56 | } |
| 57 | 57 | if (empty($dic['Yapeal.FileSystem.CacheRetriever'])) { |
| 58 | - $dic['Yapeal.FileSystem.CacheRetriever'] = function () use ($dic) { |
|
| 58 | + $dic['Yapeal.FileSystem.CacheRetriever'] = function() use ($dic) { |
|
| 59 | 59 | return new $dic['Yapeal.FileSystem.Handlers.retrieve']($dic['Yapeal.FileSystem.Cache.dir'], |
| 60 | 60 | $dic['Yapeal.FileSystem.Cache.retrieve']); |
| 61 | 61 | }; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function wire(ContainerInterface $dic) |
| 50 | 50 | { |
| 51 | 51 | if (empty($dic['Yapeal.Network.Client'])) { |
| 52 | - $dic['Yapeal.Network.Client'] = function ($dic) { |
|
| 52 | + $dic['Yapeal.Network.Client'] = function($dic) { |
|
| 53 | 53 | $appComment = $dic['Yapeal.Network.appComment']; |
| 54 | 54 | $appName = $dic['Yapeal.Network.appName']; |
| 55 | 55 | $appVersion = $dic['Yapeal.Network.appVersion']; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ]; |
| 80 | 80 | // Clean up any extra spaces and EOL chars from Yaml. |
| 81 | 81 | array_walk($headers, |
| 82 | - function (&$value) { |
|
| 82 | + function(&$value) { |
|
| 83 | 83 | $value = trim(str_replace(' ', '', (string)$value)); |
| 84 | 84 | }); |
| 85 | 85 | if ('' !== $userAgent) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | }; |
| 97 | 97 | } |
| 98 | 98 | if (empty($dic['Yapeal.Network.Retriever'])) { |
| 99 | - $dic['Yapeal.Network.Retriever'] = function ($dic) { |
|
| 99 | + $dic['Yapeal.Network.Retriever'] = function($dic) { |
|
| 100 | 100 | return new $dic['Yapeal.Network.Handlers.retrieve']($dic['Yapeal.Network.Client'], |
| 101 | 101 | $dic['Yapeal.Network.Cache:retrieve']); |
| 102 | 102 | }; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | basename(dirname($listener)), |
| 68 | 68 | basename($listener, '.php')); |
| 69 | 69 | if (empty($dic[$service])) { |
| 70 | - $dic[$service] = function () use ($dic, $service) { |
|
| 71 | - $class = '\\' . str_replace('.', '\\', $service); |
|
| 70 | + $dic[$service] = function() use ($dic, $service) { |
|
| 71 | + $class = '\\'.str_replace('.', '\\', $service); |
|
| 72 | 72 | /** |
| 73 | 73 | * @var \Yapeal\CommonToolsInterface $callable |
| 74 | 74 | */ |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | return $callable; |
| 85 | 85 | }; |
| 86 | 86 | } |
| 87 | - $mediator->addServiceListener($service . '.start', [$service, 'startEveApi'], 'last'); |
|
| 87 | + $mediator->addServiceListener($service.'.start', [$service, 'startEveApi'], 'last'); |
|
| 88 | 88 | if (false === strpos($listener, 'Section')) { |
| 89 | - $mediator->addServiceListener($service . '.preserve', [$service, 'preserveEveApi'], 'last'); |
|
| 89 | + $mediator->addServiceListener($service.'.preserve', [$service, 'preserveEveApi'], 'last'); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $rdi->setFlags($flags); |
| 108 | 108 | /** @noinspection SpellCheckingInspection */ |
| 109 | 109 | $rcfi = new \RecursiveCallbackFilterIterator($rdi, |
| 110 | - function (\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
| 110 | + function(\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
| 111 | 111 | if ($rdi->hasChildren()) { |
| 112 | 112 | return true; |
| 113 | 113 | } |
@@ -134,15 +134,15 @@ discard block |
||
| 134 | 134 | private function wireCreator(ContainerInterface $dic, MediatorInterface $mediator) |
| 135 | 135 | { |
| 136 | 136 | if (empty($dic['Yapeal.EveApi.Creator'])) { |
| 137 | - $dic['Yapeal.EveApi.Creator'] = function () use ($dic) { |
|
| 137 | + $dic['Yapeal.EveApi.Creator'] = function() use ($dic) { |
|
| 138 | 138 | $loader = new \Twig_Loader_Filesystem($dic['Yapeal.EveApi.dir']); |
| 139 | 139 | $twig = new \Twig_Environment($loader, |
| 140 | 140 | ['debug' => true, 'strict_variables' => true, 'autoescape' => false]); |
| 141 | - $filter = new \Twig_SimpleFilter('ucFirst', function ($value) { |
|
| 141 | + $filter = new \Twig_SimpleFilter('ucFirst', function($value) { |
|
| 142 | 142 | return ucfirst($value); |
| 143 | 143 | }); |
| 144 | 144 | $twig->addFilter($filter); |
| 145 | - $filter = new \Twig_SimpleFilter('lcFirst', function ($value) { |
|
| 145 | + $filter = new \Twig_SimpleFilter('lcFirst', function($value) { |
|
| 146 | 146 | return lcfirst($value); |
| 147 | 147 | }); |
| 148 | 148 | $twig->addFilter($filter); |