@@ -56,18 +56,22 @@ |
||
| 56 | 56 | public function getSettings(): array; |
| 57 | 57 | /** |
| 58 | 58 | * @throws \LogicException |
| 59 | + * @return YamlConfigFile |
|
| 59 | 60 | */ |
| 60 | 61 | public function read(); |
| 61 | 62 | /** |
| 62 | 63 | * @throws \LogicException |
| 64 | + * @return void |
|
| 63 | 65 | */ |
| 64 | 66 | public function save(); |
| 65 | 67 | /** |
| 66 | 68 | * @param string|null $value File name with absolute path. |
| 69 | + * @return YamlConfigFile |
|
| 67 | 70 | */ |
| 68 | 71 | public function setPathFile(string $value = null); |
| 69 | 72 | /** |
| 70 | 73 | * @param array $value |
| 74 | + * @return YamlConfigFile |
|
| 71 | 75 | */ |
| 72 | 76 | public function setSettings(array $value = []); |
| 73 | 77 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * constructor. |
| 177 | 177 | * |
| 178 | 178 | * @param LoggerInterface $logger |
| 179 | - * @param int|null $uncaughtExceptionLevel |
|
| 179 | + * @param integer $uncaughtExceptionLevel |
|
| 180 | 180 | */ |
| 181 | 181 | public function __construct(LoggerInterface $logger, int $uncaughtExceptionLevel) |
| 182 | 182 | { |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | /** |
| 432 | 432 | * @param ContainerInterface $dic |
| 433 | 433 | * |
| 434 | - * @return FormatterInterface |
|
| 434 | + * @return LogWiring |
|
| 435 | 435 | */ |
| 436 | 436 | function (ContainerInterface $dic): FormatterInterface { |
| 437 | 437 | $parameters = [ |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * |
| 303 | 303 | * @return HandlerInterface |
| 304 | 304 | */ |
| 305 | - $dic['Yapeal.Log.Callable.Cli'] = function (ContainerInterface $dic): HandlerInterface { |
|
| 305 | + $dic['Yapeal.Log.Callable.Cli'] = function(ContainerInterface $dic): HandlerInterface { |
|
| 306 | 306 | $parameters = [ |
| 307 | 307 | $dic['Yapeal.Log.Parameters.Cli.stream'], |
| 308 | 308 | $dic['Yapeal.Log.Parameters.Cli.level'], |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * |
| 336 | 336 | * @return HandlerInterface |
| 337 | 337 | */ |
| 338 | - $dic['Yapeal.Log.Callable.FileSystem'] = function (ContainerInterface $dic): HandlerInterface { |
|
| 338 | + $dic['Yapeal.Log.Callable.FileSystem'] = function(ContainerInterface $dic): HandlerInterface { |
|
| 339 | 339 | $parameters = [ |
| 340 | 340 | $dic['Yapeal.Log.Parameters.FileSystem.stream'], |
| 341 | 341 | $dic['Yapeal.Log.Parameters.FileSystem.level'], |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | * |
| 369 | 369 | * @return HandlerInterface |
| 370 | 370 | */ |
| 371 | - $dic['Yapeal.Log.Callable.FingersCrossed'] = function (ContainerInterface $dic): HandlerInterface { |
|
| 371 | + $dic['Yapeal.Log.Callable.FingersCrossed'] = function(ContainerInterface $dic): HandlerInterface { |
|
| 372 | 372 | /** |
| 373 | 373 | * @var string $activationStrategy |
| 374 | 374 | * @var string $handler |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | * |
| 403 | 403 | * @return HandlerInterface |
| 404 | 404 | */ |
| 405 | - $dic['Yapeal.Log.Callable.Group'] = function (ContainerInterface $dic): HandlerInterface { |
|
| 405 | + $dic['Yapeal.Log.Callable.Group'] = function(ContainerInterface $dic): HandlerInterface { |
|
| 406 | 406 | $handlers = []; |
| 407 | 407 | foreach (explode(',', $dic['Yapeal.Log.Parameters.Group.handlers']) as $handler) { |
| 408 | 408 | if ('' === $handler) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | * |
| 434 | 434 | * @return FormatterInterface |
| 435 | 435 | */ |
| 436 | - function (ContainerInterface $dic): FormatterInterface { |
|
| 436 | + function(ContainerInterface $dic): FormatterInterface { |
|
| 437 | 437 | $parameters = [ |
| 438 | 438 | $dic['Yapeal.Log.Parameters.LineFormatter.format'], |
| 439 | 439 | $dic['Yapeal.Log.Parameters.LineFormatter.dateFormat'], |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | * |
| 471 | 471 | * @return Logger |
| 472 | 472 | */ |
| 473 | - $dic['Yapeal.Log.Callable.Logger'] = function (ContainerInterface $dic): Logger { |
|
| 473 | + $dic['Yapeal.Log.Callable.Logger'] = function(ContainerInterface $dic): Logger { |
|
| 474 | 474 | /** |
| 475 | 475 | * @var \Yapeal\Log\Logger $logger |
| 476 | 476 | */ |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | * |
| 513 | 513 | * @return ActivationStrategyInterface |
| 514 | 514 | */ |
| 515 | - $dic['Yapeal.Log.Callable.Strategy'] = function (ContainerInterface $dic): ActivationStrategyInterface { |
|
| 515 | + $dic['Yapeal.Log.Callable.Strategy'] = function(ContainerInterface $dic): ActivationStrategyInterface { |
|
| 516 | 516 | return new $dic['Yapeal.Log.Classes.strategy']((int)$dic['Yapeal.Log.Parameters.Strategy.actionLevel']); |
| 517 | 517 | }; |
| 518 | 518 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | } catch (\BadMethodCallException $exc) { |
| 89 | - $this->lastErrorString = 'Failed to get SQL for ' . $this->command; |
|
| 89 | + $this->lastErrorString = 'Failed to get SQL for '.$this->command; |
|
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | if (!$this->executeCommandSql($sql)) { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | private function enforceColumnTypesAndStructure(array $columns): array |
| 204 | 204 | { |
| 205 | 205 | array_walk($columns, |
| 206 | - function (&$value, $key) { |
|
| 206 | + function(&$value, $key) { |
|
| 207 | 207 | switch ($key) { |
| 208 | 208 | case 'active': |
| 209 | 209 | $value = (bool)$value; |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | $value = (string)$value; |
| 217 | 217 | break; |
| 218 | 218 | default: |
| 219 | - $mess = 'Given unknown value ' . $key; |
|
| 219 | + $mess = 'Given unknown value '.$key; |
|
| 220 | 220 | throw new \UnexpectedValueException($mess); |
| 221 | 221 | } |
| 222 | 222 | }); |
| 223 | 223 | if (count($this->columnNames) > count($columns)) { |
| 224 | - $mess = 'Missing one or more of the required values: "' . implode('","', $this->columnNames) . '"'; |
|
| 225 | - $mess .= ' Was given "' . implode('","', array_keys($columns)) . '"'; |
|
| 224 | + $mess = 'Missing one or more of the required values: "'.implode('","', $this->columnNames).'"'; |
|
| 225 | + $mess .= ' Was given "'.implode('","', array_keys($columns)).'"'; |
|
| 226 | 226 | throw new \InvalidArgumentException($mess); |
| 227 | 227 | } |
| 228 | 228 | return $columns; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | try { |
| 239 | 239 | if (!$this->pdo->beginTransaction()) { |
| 240 | - $this->lastErrorString = 'Failed to start transaction for ' . $this->command; |
|
| 240 | + $this->lastErrorString = 'Failed to start transaction for '.$this->command; |
|
| 241 | 241 | return false; |
| 242 | 242 | } |
| 243 | 243 | $stmt = $this->pdo->prepare($sql); |
@@ -245,14 +245,14 @@ discard block |
||
| 245 | 245 | if ($this->pdo->inTransaction()) { |
| 246 | 246 | $this->pdo->rollBack(); |
| 247 | 247 | } |
| 248 | - $this->lastErrorString = 'Failed to execute prepared query for ' . $this->command; |
|
| 248 | + $this->lastErrorString = 'Failed to execute prepared query for '.$this->command; |
|
| 249 | 249 | return false; |
| 250 | 250 | } |
| 251 | 251 | if (!$this->pdo->commit()) { |
| 252 | 252 | if ($this->pdo->inTransaction()) { |
| 253 | 253 | $this->pdo->rollBack(); |
| 254 | 254 | } |
| 255 | - $this->lastErrorString = 'Failed to commit the transaction for ' . $this->command; |
|
| 255 | + $this->lastErrorString = 'Failed to commit the transaction for '.$this->command; |
|
| 256 | 256 | return false; |
| 257 | 257 | } |
| 258 | 258 | } catch (\PDOException $exc) { |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $stmt = $this->pdo->query($sql); |
| 278 | 278 | $columns = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 279 | 279 | if (1 !== count($columns)) { |
| 280 | - $this->lastErrorString = 'Expected to fetch a single row for ' . $this->command; |
|
| 280 | + $this->lastErrorString = 'Expected to fetch a single row for '.$this->command; |
|
| 281 | 281 | return false; |
| 282 | 282 | } |
| 283 | 283 | $columns = $this->enforceColumnTypesAndStructure($columns[0]); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @return EveApiPreserverInterface |
| 74 | 74 | */ |
| 75 | - $dic['Yapeal.FileSystem.Callable.CachePreserver'] = function (ContainerInterface $dic |
|
| 75 | + $dic['Yapeal.FileSystem.Callable.CachePreserver'] = function(ContainerInterface $dic |
|
| 76 | 76 | ): EveApiPreserverInterface { |
| 77 | 77 | return new $dic['Yapeal.FileSystem.Classes.preserve']($dic['Yapeal.FileSystem.Cache.dir'], |
| 78 | 78 | $dic['Yapeal.FileSystem.Parameters.preserve']); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return EveApiRetrieverInterface |
| 99 | 99 | */ |
| 100 | - $dic['Yapeal.FileSystem.Callable.CacheRetriever'] = function (ContainerInterface $dic |
|
| 100 | + $dic['Yapeal.FileSystem.Callable.CacheRetriever'] = function(ContainerInterface $dic |
|
| 101 | 101 | ): EveApiRetrieverInterface { |
| 102 | 102 | return new $dic['Yapeal.FileSystem.Classes.retrieve']($dic['Yapeal.FileSystem.Cache.dir'], |
| 103 | 103 | $dic['Yapeal.FileSystem.Parameters.retrieve']); |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | * @return \Yapeal\Xsd\Creator |
| 74 | 74 | * @throws \LogicException |
| 75 | 75 | */ |
| 76 | - $dic['Yapeal.Xsd.Callable.Creator'] = function (ContainerInterface $dic) { |
|
| 76 | + $dic['Yapeal.Xsd.Callable.Creator'] = function(ContainerInterface $dic) { |
|
| 77 | 77 | $loader = new \Twig_Loader_Filesystem($dic['Yapeal.Xsd.dir']); |
| 78 | 78 | $twig = new \Twig_Environment($loader, |
| 79 | 79 | ['debug' => true, 'strict_variables' => true, 'autoescape' => false]); |
| 80 | - $filter = new \Twig_SimpleFilter('ucFirst', function ($value) { |
|
| 80 | + $filter = new \Twig_SimpleFilter('ucFirst', function($value) { |
|
| 81 | 81 | return ucfirst($value); |
| 82 | 82 | }); |
| 83 | 83 | $twig->addFilter($filter); |
| 84 | - $filter = new \Twig_SimpleFilter('lcFirst', function ($value) { |
|
| 84 | + $filter = new \Twig_SimpleFilter('lcFirst', function($value) { |
|
| 85 | 85 | return lcfirst($value); |
| 86 | 86 | }); |
| 87 | 87 | $twig->addFilter($filter); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @return ValidatorInterface |
| 114 | 114 | */ |
| 115 | - $dic['Yapeal.Xsd.Callable.Validator'] = function (ContainerInterface $dic): ValidatorInterface { |
|
| 115 | + $dic['Yapeal.Xsd.Callable.Validator'] = function(ContainerInterface $dic): ValidatorInterface { |
|
| 116 | 116 | return new $dic['Yapeal.Xsd.Classes.validate']($dic['Yapeal.Xsd.dir']); |
| 117 | 117 | }; |
| 118 | 118 | $mediator->addServiceListener('Yapeal.EveApi.validate', |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return Client |
| 69 | 69 | */ |
| 70 | - $dic['Yapeal.Network.Callable.Client'] = function (ContainerInterface $dic): Client { |
|
| 70 | + $dic['Yapeal.Network.Callable.Client'] = function(ContainerInterface $dic): Client { |
|
| 71 | 71 | $clientParameters = $dic['Yapeal.Network.Callable.GetClientMergedParameters']; |
| 72 | 72 | $headers = [ |
| 73 | 73 | 'Accept' => $clientParameters['accept'], |
@@ -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 | $agentSubs = [ |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @return array |
| 145 | 145 | * @throws \OutOfBoundsException |
| 146 | 146 | */ |
| 147 | - $dic['Yapeal.Network.Callable.GetClientMergedParameters'] = function (ContainerInterface $dic): array { |
|
| 147 | + $dic['Yapeal.Network.Callable.GetClientMergedParameters'] = function(ContainerInterface $dic): array { |
|
| 148 | 148 | $getScalars = $dic['Yapeal.Config.Callable.ExtractScalarsByKeyPrefix']; |
| 149 | 149 | $base = []; |
| 150 | 150 | foreach ($getScalars($dic, 'Yapeal.Network.') as $index => $item) { |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * |
| 189 | 189 | * @return EveApiRetrieverInterface |
| 190 | 190 | */ |
| 191 | - $dic['Yapeal.Network.Callable.Retriever'] = function (ContainerInterface $dic): EveApiRetrieverInterface { |
|
| 191 | + $dic['Yapeal.Network.Callable.Retriever'] = function(ContainerInterface $dic): EveApiRetrieverInterface { |
|
| 192 | 192 | return new $dic['Yapeal.Network.Classes.retrieve']($dic['Yapeal.Network.Callable.Client'], |
| 193 | 193 | $dic['Yapeal.Network.Parameters.retrieve']); |
| 194 | 194 | }; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | * |
| 57 | 57 | * @return TransformerInterface |
| 58 | 58 | */ |
| 59 | - $dic['Yapeal.Xsl.Callable.Transformer'] = function (ContainerInterface $dic): TransformerInterface { |
|
| 59 | + $dic['Yapeal.Xsl.Callable.Transformer'] = function(ContainerInterface $dic): TransformerInterface { |
|
| 60 | 60 | return new $dic['Yapeal.Xsl.Classes.transform']($dic['Yapeal.Xsl.dir']); |
| 61 | 61 | }; |
| 62 | 62 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @return EveApiReadWriteInterface |
| 68 | 68 | */ |
| 69 | - $dic['Yapeal.Xml.Callable.Data'] = function (ContainerInterface $dic): EveApiReadWriteInterface { |
|
| 69 | + $dic['Yapeal.Xml.Callable.Data'] = function(ContainerInterface $dic): EveApiReadWriteInterface { |
|
| 70 | 70 | return new $dic['Yapeal.Xml.Classes.data'](); |
| 71 | 71 | }; |
| 72 | 72 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return \Yapeal\Xml\ErrorCacheIntervalSubscriber |
| 85 | 85 | */ |
| 86 | - $dic['Yapeal.Xml.Error.Callable.Subscriber'] = function (ContainerInterface $dic) { |
|
| 86 | + $dic['Yapeal.Xml.Error.Callable.Subscriber'] = function(ContainerInterface $dic) { |
|
| 87 | 87 | return new $dic['Yapeal.Xml.Classes.error'](); |
| 88 | 88 | }; |
| 89 | 89 | /** |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | $this->wireYaml($dic) |
| 54 | 54 | ->wireManager($dic) |
| 55 | 55 | ->wireExtractorCallable($dic); |
| 56 | - $path = dirname(str_replace('\\', '/', __DIR__), 2) . '/'; |
|
| 56 | + $path = dirname(str_replace('\\', '/', __DIR__), 2).'/'; |
|
| 57 | 57 | // These two paths are critical to Yapeal-ng working and can't be overridden. |
| 58 | 58 | $dic['Yapeal.baseDir'] = $path; |
| 59 | - $dic['Yapeal.libDir'] = $path . 'lib/'; |
|
| 59 | + $dic['Yapeal.libDir'] = $path.'lib/'; |
|
| 60 | 60 | $settings = $this->gitVersionSetting($dic, []); |
| 61 | 61 | $configFiles = [ |
| 62 | 62 | [ |
| 63 | - 'pathName' => str_replace('\\', '/', __DIR__) . '/yapealDefaults.yaml', |
|
| 63 | + 'pathName' => str_replace('\\', '/', __DIR__).'/yapealDefaults.yaml', |
|
| 64 | 64 | PHP_INT_MAX, |
| 65 | 65 | false |
| 66 | 66 | ] |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | if (false !== $vendorPos = strpos($path, 'vendor/')) { |
| 83 | 83 | $dic['Yapeal.vendorParentDir'] = substr($path, 0, $vendorPos); |
| 84 | - $configFiles[] = $dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'; |
|
| 84 | + $configFiles[] = $dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'; |
|
| 85 | 85 | $settings['Yapeal.FileSystem.Cache.dir'] = '{Yapeal.vendorParentDir}cache/'; |
| 86 | 86 | $settings['Yapeal.Log.dir'] = '{Yapeal.vendorParentDir}log/'; |
| 87 | 87 | } else { |
| 88 | - $configFiles[] = $path . 'config/yapeal.yaml'; |
|
| 88 | + $configFiles[] = $path.'config/yapeal.yaml'; |
|
| 89 | 89 | $settings['Yapeal.FileSystem.Cache.dir'] = '{Yapeal.baseDir}cache/'; |
| 90 | 90 | $settings['Yapeal.Log.dir'] = '{Yapeal.baseDir}log/'; |
| 91 | 91 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $gitVersion = trim(exec('git describe --always --long 2>&1', $junk, $status)); |
| 110 | 110 | if (0 === $status && '' !== $gitVersion) { |
| 111 | - $dic['Yapeal.version'] = $gitVersion . '-dev'; |
|
| 111 | + $dic['Yapeal.version'] = $gitVersion.'-dev'; |
|
| 112 | 112 | } else { |
| 113 | 113 | $settings['Yapeal.version'] = '0.0.0-0-noGit-unknown'; |
| 114 | 114 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * |
| 135 | 135 | * @return \Generator |
| 136 | 136 | */ |
| 137 | - function (ContainerInterface $dic, string $prefix): \Generator { |
|
| 137 | + function(ContainerInterface $dic, string $prefix): \Generator { |
|
| 138 | 138 | $preLen = strlen($prefix); |
| 139 | 139 | if ($preLen !== strrpos($prefix, '.') + 1) { |
| 140 | 140 | $prefix .= '.'; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @return ConfigManagementInterface |
| 174 | 174 | */ |
| 175 | - $dic['Yapeal.Configuration.Callable.Manager'] = function (ContainerInterface $dic): ConfigManagementInterface { |
|
| 175 | + $dic['Yapeal.Configuration.Callable.Manager'] = function(ContainerInterface $dic): ConfigManagementInterface { |
|
| 176 | 176 | $manager = $dic['Yapeal.Configuration.Classes.manager'] ?? '\Yapeal\Configuration\ConfigManager'; |
| 177 | 177 | /** |
| 178 | 178 | * @var ConfigManager $manager |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * |
| 199 | 199 | * @return mixed |
| 200 | 200 | */ |
| 201 | - function (ContainerInterface $dic) { |
|
| 201 | + function(ContainerInterface $dic) { |
|
| 202 | 202 | $yaml = $dic['Yapeal.Configuration.Classes.yaml'] ?? '\Yapeal\Configuration\YamlConfigFile'; |
| 203 | 203 | return new $yaml(); |
| 204 | 204 | }); |