@@ -73,7 +73,7 @@ |
||
| 73 | 73 | public function execute(InputInterface $input, OutputInterface $output): int |
| 74 | 74 | { |
| 75 | 75 | list($mSec, $sec) = explode(' ', microtime()); |
| 76 | - $output->writeln(gmdate('YmdHis', (int)$sec) . substr($mSec, 1, 4)); |
|
| 76 | + $output->writeln(gmdate('YmdHis', (int)$sec).substr($mSec, 1, 4)); |
|
| 77 | 77 | return 0; |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ->setEveApiArguments($posts); |
| 137 | 137 | if ($output::VERBOSITY_QUIET !== $output->getVerbosity()) { |
| 138 | 138 | $mess = sprintf('<info>Starting %1$s of', $this->getName()); |
| 139 | - $mess = $this->createEveApiMessage($mess, $data) . '</info>'; |
|
| 139 | + $mess = $this->createEveApiMessage($mess, $data).'</info>'; |
|
| 140 | 140 | $this->getYem() |
| 141 | 141 | ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, strip_tags($mess)); |
| 142 | 142 | $output->writeln($mess); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if (false === $data->getEveApiXml()) { |
| 148 | 148 | if ($output::VERBOSITY_QUIET !== $output->getVerbosity()) { |
| 149 | 149 | $mess = '<error>Could NOT retrieve Eve Api data of'; |
| 150 | - $mess = $this->createEveApiMessage($mess, $data) . '</error>'; |
|
| 150 | + $mess = $this->createEveApiMessage($mess, $data).'</error>'; |
|
| 151 | 151 | $this->getYem() |
| 152 | 152 | ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, strip_tags($mess)); |
| 153 | 153 | $output->writeln($mess); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $yem = $this->getYem(); |
| 124 | 124 | $statements = explode(';', $this->getCleanedUpSql($sqlStatements, $this->getReplacements())); |
| 125 | 125 | $statements = array_filter($statements, |
| 126 | - function ($statement) { |
|
| 126 | + function($statement) { |
|
| 127 | 127 | return '' !== trim($statement); |
| 128 | 128 | }); |
| 129 | 129 | $progress = null; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $progress->finish(); |
| 153 | 153 | $output->writeln(''); |
| 154 | 154 | } |
| 155 | - $mess = $sql . PHP_EOL; |
|
| 155 | + $mess = $sql.PHP_EOL; |
|
| 156 | 156 | $mess .= sprintf('Sql failed in %1$s on statement %2$s with (%3$s) %4$s', |
| 157 | 157 | $fileName, |
| 158 | 158 | $statement, |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $base = 'Yapeal.Sql.'; |
| 197 | 197 | foreach (['class', 'database', 'hostName', 'password', 'platform', 'tablePrefix', 'userName'] as $option) { |
| 198 | 198 | if (array_key_exists($option, $options) && null !== $options[$option]) { |
| 199 | - $dic[$base . $option] = $options[$option]; |
|
| 199 | + $dic[$base.$option] = $options[$option]; |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | return $this; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function getEveApiArgument(string $name): string |
| 78 | 78 | { |
| 79 | 79 | if (!array_key_exists($name, $this->eveApiArguments)) { |
| 80 | - $mess = 'Unknown argument ' . $name; |
|
| 80 | + $mess = 'Unknown argument '.$name; |
|
| 81 | 81 | throw new \DomainException($mess); |
| 82 | 82 | } |
| 83 | 83 | return $this->eveApiArguments[$name]; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function getHash(): string |
| 141 | 141 | { |
| 142 | - $hash = $this->getEveApiName() . $this->getEveApiSectionName(); |
|
| 142 | + $hash = $this->getEveApiName().$this->getEveApiSectionName(); |
|
| 143 | 143 | $arguments = $this->getEveApiArguments(); |
| 144 | 144 | if (!in_array($this->getEveApiName(), ['accountBalance', 'walletJournal', 'walletTransactions'], true)) { |
| 145 | 145 | unset($arguments['accountKey']); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | unset($arguments['mask'], $arguments['rowCount']); |
| 148 | 148 | ksort($arguments); |
| 149 | 149 | foreach ($arguments as $key => $value) { |
| 150 | - $hash .= $key . $value; |
|
| 150 | + $hash .= $key.$value; |
|
| 151 | 151 | } |
| 152 | 152 | return hash('md5', $hash); |
| 153 | 153 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | public function setEveApiName(string $value) |
| 218 | 218 | { |
| 219 | 219 | if (!is_string($value)) { |
| 220 | - $mess = 'Name MUST be string but was given ' . gettype($value); |
|
| 220 | + $mess = 'Name MUST be string but was given '.gettype($value); |
|
| 221 | 221 | throw new \InvalidArgumentException($mess); |
| 222 | 222 | } |
| 223 | 223 | $this->eveApiName = $value; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | public function setEveApiSectionName(string $value) |
| 235 | 235 | { |
| 236 | 236 | if (!is_string($value)) { |
| 237 | - $mess = 'Section name MUST be string but was given ' . gettype($value); |
|
| 237 | + $mess = 'Section name MUST be string but was given '.gettype($value); |
|
| 238 | 238 | throw new \InvalidArgumentException($mess); |
| 239 | 239 | } |
| 240 | 240 | $this->eveApiSectionName = $value; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $xml = ''; |
| 255 | 255 | } |
| 256 | 256 | if (!is_string($xml)) { |
| 257 | - $mess = 'Xml MUST be string but was given ' . gettype($xml); |
|
| 257 | + $mess = 'Xml MUST be string but was given '.gettype($xml); |
|
| 258 | 258 | throw new \InvalidArgumentException($mess); |
| 259 | 259 | } |
| 260 | 260 | $this->eveApiXml = $xml; |
@@ -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); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $statements = explode("\n", $sql); |
| 71 | 71 | // Filter out non-sql lines like comments and blank lines. |
| 72 | 72 | $statements = array_filter($statements, |
| 73 | - function ($statement) { |
|
| 73 | + function($statement) { |
|
| 74 | 74 | /** @noinspection IfReturnReturnSimplificationInspection */ |
| 75 | 75 | if (0 === strpos($statement, '-- ') |
| 76 | 76 | || '' === trim($statement) |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | protected function getSqlSubs(ContainerInterface $dic) |
| 93 | 93 | { |
| 94 | 94 | $keys = $dic->keys(); |
| 95 | - $platform = '.' . $dic['Yapeal.Sql.platform']; |
|
| 95 | + $platform = '.'.$dic['Yapeal.Sql.platform']; |
|
| 96 | 96 | $filteredKeys = array_filter($keys, |
| 97 | - function ($key) use ($platform) { |
|
| 97 | + function($key) use ($platform) { |
|
| 98 | 98 | $classes = ['Yapeal.Sql.CommonQueries', 'Yapeal.Sql.Connection', 'Yapeal.Sql.Creator']; |
| 99 | 99 | $isPlatform = false !== strpos($key, $platform); |
| 100 | 100 | $hasPlatforms = false !== strpos($key, 'Platforms.'); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | }); |
| 107 | 107 | $replacements = []; |
| 108 | 108 | foreach ($filteredKeys as $key) { |
| 109 | - $subName = '{' . substr($key, strrpos($key, '.') + 1) . '}'; |
|
| 109 | + $subName = '{'.substr($key, strrpos($key, '.') + 1).'}'; |
|
| 110 | 110 | $replacements[$subName] = $dic[$key]; |
| 111 | 111 | } |
| 112 | 112 | return $replacements; |
@@ -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(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $fileNames = explode(',', |
| 91 | 91 | sprintf('%1$s%2$s.%3$s.sql,%1$s%2$s.sql', |
| 92 | - $this->getDic()['Yapeal.Sql.dir'] . 'queries/', |
|
| 92 | + $this->getDic()['Yapeal.Sql.dir'].'queries/', |
|
| 93 | 93 | $name, |
| 94 | 94 | $this->getDic()['Yapeal.Sql.platform'])); |
| 95 | 95 | foreach ($fileNames as $fileName) { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | return $this->processSql($fileName, $sql, $arguments); |
| 107 | 107 | } |
| 108 | - $mess = 'Unknown method ' . $name; |
|
| 108 | + $mess = 'Unknown method '.$name; |
|
| 109 | 109 | throw new \BadMethodCallException($mess); |
| 110 | 110 | } |
| 111 | 111 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $replacements = $this->getReplacements(); |
| 122 | 122 | $replacements['{tableName}'] = $tableName; |
| 123 | 123 | $replacements['{columnNames}'] = implode('","', $columnNameList); |
| 124 | - $rowPrototype = '(' . implode(',', array_fill(0, count($columnNameList), '?')) . ')'; |
|
| 124 | + $rowPrototype = '('.implode(',', array_fill(0, count($columnNameList), '?')).')'; |
|
| 125 | 125 | $replacements['{rowset}'] = implode(',', array_fill(0, $rowCount, $rowPrototype)); |
| 126 | 126 | $updates = []; |
| 127 | 127 | foreach ($columnNameList as $column) { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function wire(ContainerInterface $dic) |
| 55 | 55 | { |
| 56 | 56 | if (empty($dic['Yapeal.Sql.CommonQueries'])) { |
| 57 | - $dic['Yapeal.Sql.CommonQueries'] = function ($dic) { |
|
| 57 | + $dic['Yapeal.Sql.CommonQueries'] = function($dic) { |
|
| 58 | 58 | /** |
| 59 | 59 | * @var CommonSqlQueries $csq |
| 60 | 60 | */ |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | if (empty($dic['Yapeal.Sql.Connection'])) { |
| 79 | 79 | $replacements = $this->getSqlSubs($dic); |
| 80 | - $dic['Yapeal.Sql.Connection'] = function () use ($dic, $replacements) { |
|
| 80 | + $dic['Yapeal.Sql.Connection'] = function() use ($dic, $replacements) { |
|
| 81 | 81 | $dsn = $replacements['{dsn}']; |
| 82 | 82 | $dsn = str_replace(array_keys($replacements), array_values($replacements), $dsn); |
| 83 | 83 | /** |
@@ -103,15 +103,15 @@ discard block |
||
| 103 | 103 | private function wireCreator(ContainerInterface $dic) |
| 104 | 104 | { |
| 105 | 105 | if (empty($dic['Yapeal.Sql.Creator'])) { |
| 106 | - $dic['Yapeal.Sql.Creator'] = function () use ($dic) { |
|
| 106 | + $dic['Yapeal.Sql.Creator'] = function() use ($dic) { |
|
| 107 | 107 | $loader = new \Twig_Loader_Filesystem($dic['Yapeal.Sql.dir']); |
| 108 | 108 | $twig = new \Twig_Environment($loader, |
| 109 | 109 | ['debug' => true, 'strict_variables' => true, 'autoescape' => false]); |
| 110 | - $filter = new \Twig_SimpleFilter('ucFirst', function ($value) { |
|
| 110 | + $filter = new \Twig_SimpleFilter('ucFirst', function($value) { |
|
| 111 | 111 | return ucfirst($value); |
| 112 | 112 | }); |
| 113 | 113 | $twig->addFilter($filter); |
| 114 | - $filter = new \Twig_SimpleFilter('lcFirst', function ($value) { |
|
| 114 | + $filter = new \Twig_SimpleFilter('lcFirst', function($value) { |
|
| 115 | 115 | return lcfirst($value); |
| 116 | 116 | }); |
| 117 | 117 | $twig->addFilter($filter); |