@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $names = ['Config', 'Error', 'Event', 'Log', 'Sql', 'Xml', 'Xsd', 'Xsl', 'Cache', 'Network', 'EveApi']; |
| 74 | 74 | foreach ($names as $name) { |
| 75 | - $className = __NAMESPACE__ . '\\' . $name . 'Wiring'; |
|
| 75 | + $className = __NAMESPACE__.'\\'.$name.'Wiring'; |
|
| 76 | 76 | if (class_exists($className, true)) { |
| 77 | 77 | /** |
| 78 | 78 | * @var WiringInterface $class |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | $class->wire($this->dic); |
| 82 | 82 | continue; |
| 83 | 83 | } |
| 84 | - $methodName = 'wire' . $name; |
|
| 84 | + $methodName = 'wire'.$name; |
|
| 85 | 85 | if (method_exists($this, $methodName)) { |
| 86 | 86 | $this->$methodName(); |
| 87 | 87 | } else { |
| 88 | - $mess = 'Could NOT find class or method for ' . $name; |
|
| 88 | + $mess = 'Could NOT find class or method for '.$name; |
|
| 89 | 89 | throw new \LogicException($mess); |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | do { |
| 111 | 111 | $settings = preg_replace_callback( |
| 112 | 112 | $regEx, |
| 113 | - function ($match) use ($settings, $dic) { |
|
| 113 | + function($match) use ($settings, $dic) { |
|
| 114 | 114 | if (!empty($settings[$match['name']])) { |
| 115 | 115 | return $settings[$match['name']]; |
| 116 | 116 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if (PREG_NO_ERROR !== $lastError) { |
| 132 | 132 | $constants = array_flip(get_defined_constants(true)['pcre']); |
| 133 | 133 | $lastError = $constants[$lastError]; |
| 134 | - $mess = 'Received preg error ' . $lastError; |
|
| 134 | + $mess = 'Received preg error '.$lastError; |
|
| 135 | 135 | throw new \DomainException($mess); |
| 136 | 136 | } |
| 137 | 137 | } while ($count > 0); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $rdi->setFlags($flags); |
| 151 | 151 | /** @noinspection SpellCheckingInspection */ |
| 152 | 152 | $rcfi = new \RecursiveCallbackFilterIterator( |
| 153 | - $rdi, function (\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
| 153 | + $rdi, function(\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
| 154 | 154 | if ($rdi->hasChildren()) { |
| 155 | 155 | return true; |
| 156 | 156 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | ); |
| 201 | 201 | } catch (ParseException $exc) { |
| 202 | 202 | $mess = sprintf( |
| 203 | - 'Unable to parse the YAML configuration file %2$s.' . ' The error message was %1$s', |
|
| 203 | + 'Unable to parse the YAML configuration file %2$s.'.' The error message was %1$s', |
|
| 204 | 204 | $exc->getMessage(), |
| 205 | 205 | $configFile |
| 206 | 206 | ); |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | $dic['Yapeal.baseDir'] = $path; |
| 237 | 237 | } |
| 238 | 238 | if (empty($dic['Yapeal.libDir'])) { |
| 239 | - $dic['Yapeal.libDir'] = $path . 'lib/'; |
|
| 239 | + $dic['Yapeal.libDir'] = $path.'lib/'; |
|
| 240 | 240 | } |
| 241 | 241 | $configFiles = [ |
| 242 | - $fpn->normalizeFile(__DIR__ . '/yapeal_defaults.yaml'), |
|
| 243 | - $fpn->normalizeFile($dic['Yapeal.baseDir'] . 'config/yapeal.yaml') |
|
| 242 | + $fpn->normalizeFile(__DIR__.'/yapeal_defaults.yaml'), |
|
| 243 | + $fpn->normalizeFile($dic['Yapeal.baseDir'].'config/yapeal.yaml') |
|
| 244 | 244 | ]; |
| 245 | 245 | if (empty($dic['Yapeal.vendorParentDir'])) { |
| 246 | 246 | $vendorPos = strpos( |
@@ -249,10 +249,10 @@ discard block |
||
| 249 | 249 | ); |
| 250 | 250 | if (false !== $vendorPos) { |
| 251 | 251 | $dic['Yapeal.vendorParentDir'] = substr($path, 0, $vendorPos); |
| 252 | - $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'); |
|
| 252 | + $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'); |
|
| 253 | 253 | } |
| 254 | 254 | } else { |
| 255 | - $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'); |
|
| 255 | + $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'); |
|
| 256 | 256 | } |
| 257 | 257 | $settings = []; |
| 258 | 258 | // Process each file in turn so any substitutions are done in a more |
@@ -298,8 +298,8 @@ discard block |
||
| 298 | 298 | basename($subscriber, '.php') |
| 299 | 299 | ); |
| 300 | 300 | if (!isset($dic[$service])) { |
| 301 | - $dic[$service] = function () use ($dic, $service) { |
|
| 302 | - $class = '\\' . str_replace('.', '\\', $service); |
|
| 301 | + $dic[$service] = function() use ($dic, $service) { |
|
| 302 | + $class = '\\'.str_replace('.', '\\', $service); |
|
| 303 | 303 | /** |
| 304 | 304 | * @var \Yapeal\EveApi\EveApiToolsTrait $callable |
| 305 | 305 | */ |
@@ -308,27 +308,27 @@ discard block |
||
| 308 | 308 | ->setPdo($dic['Yapeal.Sql.Connection']); |
| 309 | 309 | }; |
| 310 | 310 | } |
| 311 | - $events = [$service . '.start' => ['startEveApi', 'last']]; |
|
| 311 | + $events = [$service.'.start' => ['startEveApi', 'last']]; |
|
| 312 | 312 | if (false === strpos($subscriber, 'Section')) { |
| 313 | - $events[$service . '.preserve'] = ['preserveEveApi', 'last']; |
|
| 313 | + $events[$service.'.preserve'] = ['preserveEveApi', 'last']; |
|
| 314 | 314 | } |
| 315 | 315 | $mediator->addServiceSubscriberByEventList($service, $events); |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | if (empty($dic['Yapeal.EveApi.Creator'])) { |
| 319 | - $dic['Yapeal.EveApi.Creator'] = function () use ($dic) { |
|
| 319 | + $dic['Yapeal.EveApi.Creator'] = function() use ($dic) { |
|
| 320 | 320 | $loader = new Twig_Loader_Filesystem($dic['Yapeal.EveApi.dir']); |
| 321 | 321 | $twig = new Twig_Environment( |
| 322 | 322 | $loader, ['debug' => true, 'strict_variables' => true, 'autoescape' => false] |
| 323 | 323 | ); |
| 324 | 324 | $filter = new Twig_SimpleFilter( |
| 325 | - 'ucFirst', function ($value) { |
|
| 325 | + 'ucFirst', function($value) { |
|
| 326 | 326 | return ucfirst($value); |
| 327 | 327 | } |
| 328 | 328 | ); |
| 329 | 329 | $twig->addFilter($filter); |
| 330 | 330 | $filter = new Twig_SimpleFilter( |
| 331 | - 'lcFirst', function ($value) { |
|
| 331 | + 'lcFirst', function($value) { |
|
| 332 | 332 | return lcfirst($value); |
| 333 | 333 | } |
| 334 | 334 | ); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function wire(ContainerInterface $dic) |
| 50 | 50 | { |
| 51 | 51 | if (empty($dic['Yapeal.Log.Logger'])) { |
| 52 | - $dic['Yapeal.Log.Logger'] = function () use ($dic) { |
|
| 52 | + $dic['Yapeal.Log.Logger'] = function() use ($dic) { |
|
| 53 | 53 | $group = []; |
| 54 | 54 | $lineFormatter = new LineFormatter(); |
| 55 | 55 | $lineFormatter->includeStacktraces(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $group[] = $handler; |
| 66 | 66 | } |
| 67 | 67 | $handler = new $dic['Yapeal.Log.Handlers.stream']( |
| 68 | - $dic['Yapeal.Log.dir'] . $dic['Yapeal.Log.fileName'], 100 |
|
| 68 | + $dic['Yapeal.Log.dir'].$dic['Yapeal.Log.fileName'], 100 |
|
| 69 | 69 | ); |
| 70 | 70 | $handler->setFormatter($lineFormatter); |
| 71 | 71 | $group[] = $handler; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if (!empty($dic['Yapeal.Error.Logger'])) { |
| 53 | 53 | return $this; |
| 54 | 54 | } |
| 55 | - $dic['Yapeal.Error.Logger'] = function ($dic) { |
|
| 55 | + $dic['Yapeal.Error.Logger'] = function($dic) { |
|
| 56 | 56 | /** |
| 57 | 57 | * @var Logger $logger |
| 58 | 58 | */ |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ('cli' === PHP_SAPI) { |
| 62 | 62 | $group[] = new $dic['Yapeal.Error.Handlers.stream']('php://stderr', 100); |
| 63 | 63 | } |
| 64 | - $group[] = new $dic['Yapeal.Error.Handlers.stream']($dic['Yapeal.Error.dir'] . $dic['Yapeal.Error.fileName'], |
|
| 64 | + $group[] = new $dic['Yapeal.Error.Handlers.stream']($dic['Yapeal.Error.dir'].$dic['Yapeal.Error.fileName'], |
|
| 65 | 65 | 100); |
| 66 | 66 | $logger->pushHandler( |
| 67 | 67 | new $dic['Yapeal.Error.Handlers.fingersCrossed'](new $dic['Yapeal.Error.Handlers.group']($group), |
@@ -77,25 +77,25 @@ discard block |
||
| 77 | 77 | $this->setYem($dic['Yapeal.Event.Mediator']); |
| 78 | 78 | $mess = 'Let the magic begin!'; |
| 79 | 79 | $this->getYem() |
| 80 | - ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess); |
|
| 80 | + ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess); |
|
| 81 | 81 | /** |
| 82 | 82 | * @var CommonSqlQueries $csq |
| 83 | 83 | */ |
| 84 | 84 | $csq = $dic['Yapeal.Sql.CommonQueries']; |
| 85 | 85 | $sql = $csq->getActiveApis(); |
| 86 | 86 | $this->getYem() |
| 87 | - ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $sql); |
|
| 87 | + ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $sql); |
|
| 88 | 88 | try { |
| 89 | 89 | /** |
| 90 | 90 | * @var PDO $pdo |
| 91 | 91 | */ |
| 92 | 92 | $pdo = $dic['Yapeal.Sql.Connection']; |
| 93 | 93 | $records = $pdo->query($sql) |
| 94 | - ->fetchAll(PDO::FETCH_ASSOC); |
|
| 94 | + ->fetchAll(PDO::FETCH_ASSOC); |
|
| 95 | 95 | } catch (PDOException $exc) { |
| 96 | 96 | $mess = 'Could not access utilEveApi table'; |
| 97 | 97 | $this->getYem() |
| 98 | - ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess, ['exception' => $exc]); |
|
| 98 | + ->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess, ['exception' => $exc]); |
|
| 99 | 99 | return 1; |
| 100 | 100 | } |
| 101 | 101 | // Always check APIKeyInfo. |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | $data = $dic['Yapeal.Xml.Data']; |
| 118 | 118 | $data->setEveApiName($record['apiName']) |
| 119 | - ->setEveApiSectionName($record['sectionName']) |
|
| 120 | - ->setCacheInterval($record['interval']); |
|
| 119 | + ->setEveApiSectionName($record['sectionName']) |
|
| 120 | + ->setCacheInterval($record['interval']); |
|
| 121 | 121 | $this->emitEvents($data, 'start'); |
| 122 | 122 | } |
| 123 | 123 | return 0; |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | protected function saveToFile($fileName, $contents) |
| 132 | 132 | { |
| 133 | 133 | $fileName = $this->getFpn() |
| 134 | - ->normalizeFile($fileName); |
|
| 134 | + ->normalizeFile($fileName); |
|
| 135 | 135 | return file_put_contents($fileName, $contents); |
| 136 | 136 | } |
| 137 | 137 | /** |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | continue; |
| 119 | 119 | } |
| 120 | 120 | $fileList[] = $this->getFpn() |
| 121 | - ->normalizeFile($fileInfo->getPathname()); |
|
| 121 | + ->normalizeFile($fileInfo->getPathname()); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | $fileNames = '%1$sCreateCustomTables.sql,%2$sconfig/CreateCustomTables.sql'; |
@@ -58,16 +58,16 @@ |
||
| 58 | 58 | protected function addOptions($help) |
| 59 | 59 | { |
| 60 | 60 | $this->addOption('configFile', 'c', InputOption::VALUE_REQUIRED, 'Configuration file to get settings from.') |
| 61 | - ->addOption('database', 'd', InputOption::VALUE_REQUIRED, 'Name of the database.') |
|
| 62 | - ->addOption('hostName', 'o', InputOption::VALUE_REQUIRED, 'Host name for database server.') |
|
| 63 | - ->addOption('password', 'p', InputOption::VALUE_REQUIRED, 'Password used to access database.') |
|
| 64 | - ->addOption('platform', null, InputOption::VALUE_REQUIRED, |
|
| 65 | - 'Platform of database driver. Currently only "mysql".') |
|
| 66 | - ->addOption('port', null, InputOption::VALUE_REQUIRED, |
|
| 67 | - 'Port number for remote server. Only needed if using http connection.') |
|
| 68 | - ->addOption('tablePrefix', 't', InputOption::VALUE_REQUIRED, 'Prefix for database table names.') |
|
| 69 | - ->addOption('userName', 'u', InputOption::VALUE_REQUIRED, 'User name used to access database.') |
|
| 70 | - ->setHelp($help); |
|
| 61 | + ->addOption('database', 'd', InputOption::VALUE_REQUIRED, 'Name of the database.') |
|
| 62 | + ->addOption('hostName', 'o', InputOption::VALUE_REQUIRED, 'Host name for database server.') |
|
| 63 | + ->addOption('password', 'p', InputOption::VALUE_REQUIRED, 'Password used to access database.') |
|
| 64 | + ->addOption('platform', null, InputOption::VALUE_REQUIRED, |
|
| 65 | + 'Platform of database driver. Currently only "mysql".') |
|
| 66 | + ->addOption('port', null, InputOption::VALUE_REQUIRED, |
|
| 67 | + 'Port number for remote server. Only needed if using http connection.') |
|
| 68 | + ->addOption('tablePrefix', 't', InputOption::VALUE_REQUIRED, 'Prefix for database table names.') |
|
| 69 | + ->addOption('userName', 'u', InputOption::VALUE_REQUIRED, 'User name used to access database.') |
|
| 70 | + ->setHelp($help); |
|
| 71 | 71 | } |
| 72 | 72 | /** @noinspection PhpMissingParentCallCommonInspection */ |
| 73 | 73 | /** |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | $data = $this->getDic()['Yapeal.Xml.Data']; |
| 90 | 90 | $data->setEveApiName($apiName) |
| 91 | - ->setEveApiSectionName($sectionName) |
|
| 92 | - ->setEveApiArguments($posts); |
|
| 91 | + ->setEveApiSectionName($sectionName) |
|
| 92 | + ->setEveApiArguments($posts); |
|
| 93 | 93 | foreach (['retrieve', 'create', 'transform', 'validate', 'cache'] as $eventName) { |
| 94 | 94 | if (false === $this->emitEvents($data, $eventName)) { |
| 95 | 95 | return 2; |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | EOF; |
| 117 | 117 | $this->addArgument('section_name', InputArgument::REQUIRED, 'Name of Eve Api section to retrieve.') |
| 118 | - ->addArgument('api_name', InputArgument::REQUIRED, 'Name of Eve Api to retrieve.') |
|
| 119 | - ->addArgument('mask', InputArgument::REQUIRED, 'Bit mask for Eve Api.') |
|
| 120 | - ->addArgument('post', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, |
|
| 121 | - 'Optional list of additional POST parameter(s) to send to server.', []) |
|
| 122 | - ->addOption('overwrite', null, InputOption::VALUE_NONE, |
|
| 123 | - 'Causes command to overwrite any existing per Eve API files.') |
|
| 124 | - ->setHelp($help); |
|
| 118 | + ->addArgument('api_name', InputArgument::REQUIRED, 'Name of Eve Api to retrieve.') |
|
| 119 | + ->addArgument('mask', InputArgument::REQUIRED, 'Bit mask for Eve Api.') |
|
| 120 | + ->addArgument('post', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, |
|
| 121 | + 'Optional list of additional POST parameter(s) to send to server.', []) |
|
| 122 | + ->addOption('overwrite', null, InputOption::VALUE_NONE, |
|
| 123 | + 'Causes command to overwrite any existing per Eve API files.') |
|
| 124 | + ->setHelp($help); |
|
| 125 | 125 | } |
| 126 | 126 | /** @noinspection PhpMissingParentCallCommonInspection */ |
| 127 | 127 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $output->writeln($name); |
| 124 | 124 | $this->executeSqlStatements( |
| 125 | 125 | $this->getCsq() |
| 126 | - ->getDropAddOrModifyColumnProcedure(), |
|
| 126 | + ->getDropAddOrModifyColumnProcedure(), |
|
| 127 | 127 | $name, |
| 128 | 128 | $output |
| 129 | 129 | ); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ->getUtilLatestDatabaseVersion(); |
| 144 | 144 | try { |
| 145 | 145 | $result = $this->getPdo() |
| 146 | - ->query($sql, PDO::FETCH_NUM); |
|
| 146 | + ->query($sql, PDO::FETCH_NUM); |
|
| 147 | 147 | $version = $result->fetchColumn(); |
| 148 | 148 | $result->closeCursor(); |
| 149 | 149 | } catch (PDOException $exc) { |
@@ -263,10 +263,10 @@ discard block |
||
| 263 | 263 | $updateVersion |
| 264 | 264 | ); |
| 265 | 265 | if ($this->getPdo() |
| 266 | - ->inTransaction() |
|
| 266 | + ->inTransaction() |
|
| 267 | 267 | ) { |
| 268 | 268 | $this->getPdo() |
| 269 | - ->rollBack(); |
|
| 269 | + ->rollBack(); |
|
| 270 | 270 | } |
| 271 | 271 | throw new YapealDatabaseException($mess, 2); |
| 272 | 272 | } |