@@ -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(); |
@@ -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); |
@@ -49,17 +49,17 @@ |
||
| 49 | 49 | public function wire(ContainerInterface $dic) |
| 50 | 50 | { |
| 51 | 51 | if (empty($dic['Yapeal.Event.EveApiEvent'])) { |
| 52 | - $dic['Yapeal.Event.EveApi'] = $dic->factory(function ($dic) { |
|
| 52 | + $dic['Yapeal.Event.EveApi'] = $dic->factory(function($dic) { |
|
| 53 | 53 | return new $dic['Yapeal.Event.Factories.eveApi'](); |
| 54 | 54 | }); |
| 55 | 55 | } |
| 56 | 56 | if (empty($dic['Yapeal.Event.LogEvent'])) { |
| 57 | - $dic['Yapeal.Event.LogEvent'] = $dic->factory(function ($dic) { |
|
| 57 | + $dic['Yapeal.Event.LogEvent'] = $dic->factory(function($dic) { |
|
| 58 | 58 | return new $dic['Yapeal.Event.Factories.log']; |
| 59 | 59 | }); |
| 60 | 60 | } |
| 61 | 61 | if (empty($dic['Yapeal.Event.Mediator'])) { |
| 62 | - $dic['Yapeal.Event.Mediator'] = function ($dic) { |
|
| 62 | + $dic['Yapeal.Event.Mediator'] = function($dic) { |
|
| 63 | 63 | return new $dic['Yapeal.Event.Handlers.mediator']($dic); |
| 64 | 64 | }; |
| 65 | 65 | } |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | } |
| 77 | 77 | $data = $event->getData(); |
| 78 | 78 | $apiName = $data->getEveApiName(); |
| 79 | - $data->setEveApiName($apiName . 'History'); |
|
| 79 | + $data->setEveApiName($apiName.'History'); |
|
| 80 | 80 | // Insure history has already been updated first so current data overwrites old data. |
| 81 | 81 | $this->emitEvents($data, 'start'); |
| 82 | 82 | $data->setEveApiName($apiName) |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | if (false === $this->deleteWithRetry($pathFile)) { |
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | - $tmpFile = sprintf('%1$s/%2$s.tmp', $path, hash('sha1', $baseFile . microtime())); |
|
| 80 | + $tmpFile = sprintf('%1$s/%2$s.tmp', $path, hash('sha1', $baseFile.microtime())); |
|
| 81 | 81 | if (false === $this->safeDataWrite($data, $tmpFile)) { |
| 82 | 82 | return false; |
| 83 | 83 | } |
@@ -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() |
@@ -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; |