@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | if ($code < 200) { |
82 | 82 | if (false !== strpos($mess, 'retry after')) { |
83 | - $data->setCacheInterval(strtotime(substr($mess, -19) . '+00:00') - time()); |
|
83 | + $data->setCacheInterval(strtotime(substr($mess, -19).'+00:00') - time()); |
|
84 | 84 | } |
85 | 85 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::WARNING, |
86 | 86 | $this->createEventMessage($mess, $data, $eventName)); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $data->setCacheInterval(300); |
98 | 98 | } |
99 | 99 | $apiName = $data->getEveApiName(); |
100 | - $data->setEveApiName('Error_' . $apiName); |
|
100 | + $data->setEveApiName('Error_'.$apiName); |
|
101 | 101 | // Cache error XML. |
102 | 102 | $this->emitEvents($data, 'cache'); |
103 | 103 | $data->setEveApiName($apiName); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Xsl.Transformer'])) { |
53 | 53 | $dic['Yapeal.Xsl.Transformer'] = $dic->factory( |
54 | - function ($dic) { |
|
54 | + function($dic) { |
|
55 | 55 | return new $dic['Yapeal.Xsl.transform']($dic['Yapeal.Xsl.dir']); |
56 | 56 | } |
57 | 57 | ); |
@@ -51,14 +51,14 @@ |
||
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Xml.Data'])) { |
53 | 53 | $dic['Yapeal.Xml.Data'] = $dic->factory( |
54 | - function ($dic) { |
|
54 | + function($dic) { |
|
55 | 55 | return new $dic['Yapeal.Xml.data'](); |
56 | 56 | } |
57 | 57 | ); |
58 | 58 | } |
59 | 59 | if (empty($dic['Yapeal.Xml.Error.Subscriber'])) { |
60 | 60 | $dic['Yapeal.Xml.Error.Subscriber'] = $dic->factory( |
61 | - function ($dic) { |
|
61 | + function($dic) { |
|
62 | 62 | return new $dic['Yapeal.Xml.Handlers.error'](); |
63 | 63 | } |
64 | 64 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function wire(ContainerInterface $dic) |
56 | 56 | { |
57 | 57 | if (empty($dic['Yapeal.Sql.CommonQueries'])) { |
58 | - $dic['Yapeal.Sql.CommonQueries'] = function ($dic) { |
|
58 | + $dic['Yapeal.Sql.CommonQueries'] = function($dic) { |
|
59 | 59 | return new $dic['Yapeal.Sql.sharedSql']( |
60 | 60 | $dic['Yapeal.Sql.database'], $dic['Yapeal.Sql.tablePrefix'] |
61 | 61 | ); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | return $this; |
66 | 66 | } |
67 | 67 | if ('mysql' !== $dic['Yapeal.Sql.platform']) { |
68 | - $mess = 'Unknown platform, was given ' . $dic['Yapeal.Sql.platform']; |
|
68 | + $mess = 'Unknown platform, was given '.$dic['Yapeal.Sql.platform']; |
|
69 | 69 | throw new YapealDatabaseException($mess); |
70 | 70 | } |
71 | - $dic['Yapeal.Sql.Connection'] = function ($dic) { |
|
72 | - $dsn = $dic['Yapeal.Sql.platform'] . ':host=' . $dic['Yapeal.Sql.hostName'] . ';charset=utf8'; |
|
71 | + $dic['Yapeal.Sql.Connection'] = function($dic) { |
|
72 | + $dsn = $dic['Yapeal.Sql.platform'].':host='.$dic['Yapeal.Sql.hostName'].';charset=utf8'; |
|
73 | 73 | if (!empty($dic['Yapeal.Sql.port'])) { |
74 | - $dsn .= ';port=' . $dic['Yapeal.Sql.port']; |
|
74 | + $dsn .= ';port='.$dic['Yapeal.Sql.port']; |
|
75 | 75 | } |
76 | 76 | /** |
77 | 77 | * @var PDO $database |
@@ -88,24 +88,24 @@ discard block |
||
88 | 88 | $database->exec('SET SESSION TIME_ZONE=\'+00:00\''); |
89 | 89 | $database->exec('SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci'); |
90 | 90 | $database->exec('SET COLLATION_CONNECTION=utf8mb4_unicode_520_ci'); |
91 | - $database->exec('SET DEFAULT_STORAGE_ENGINE=' . $dic['Yapeal.Sql.engine']); |
|
91 | + $database->exec('SET DEFAULT_STORAGE_ENGINE='.$dic['Yapeal.Sql.engine']); |
|
92 | 92 | return $database; |
93 | 93 | }; |
94 | 94 | if (empty($dic['Yapeal.Sql.Creator'])) { |
95 | 95 | $dic['Yapeal.Sql.Creator'] = $dic->factory( |
96 | - function ($dic) { |
|
96 | + function($dic) { |
|
97 | 97 | $loader = new Twig_Loader_Filesystem($dic['Yapeal.Sql.dir']); |
98 | 98 | $twig = new Twig_Environment( |
99 | 99 | $loader, ['debug' => true, 'strict_variables' => true, 'autoescape' => false] |
100 | 100 | ); |
101 | 101 | $filter = new Twig_SimpleFilter( |
102 | - 'ucFirst', function ($value) { |
|
102 | + 'ucFirst', function($value) { |
|
103 | 103 | return ucfirst($value); |
104 | 104 | } |
105 | 105 | ); |
106 | 106 | $twig->addFilter($filter); |
107 | 107 | $filter = new Twig_SimpleFilter( |
108 | - 'lcFirst', function ($value) { |
|
108 | + 'lcFirst', function($value) { |
|
109 | 109 | return lcfirst($value); |
110 | 110 | } |
111 | 111 | ); |
@@ -50,12 +50,12 @@ |
||
50 | 50 | { |
51 | 51 | if ('none' !== $dic['Yapeal.Cache.fileSystemMode']) { |
52 | 52 | if (empty($dic['Yapeal.FileSystem.CachePreserver'])) { |
53 | - $dic['Yapeal.FileSystem.CachePreserver'] = function () use ($dic) { |
|
53 | + $dic['Yapeal.FileSystem.CachePreserver'] = function() use ($dic) { |
|
54 | 54 | return new $dic['Yapeal.Cache.Handlers.preserve']($dic['Yapeal.Cache.dir']); |
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.Cache.Handlers.retrieve']($dic['Yapeal.Cache.dir']); |
60 | 60 | }; |
61 | 61 | } |
@@ -50,20 +50,20 @@ |
||
50 | 50 | { |
51 | 51 | if (empty($dic['Yapeal.Event.EveApiEvent'])) { |
52 | 52 | $dic['Yapeal.Event.EveApi'] = $dic->factory( |
53 | - function ($dic) { |
|
53 | + function($dic) { |
|
54 | 54 | return new $dic['Yapeal.Event.Factories.eveApi'](); |
55 | 55 | } |
56 | 56 | ); |
57 | 57 | } |
58 | 58 | if (empty($dic['Yapeal.Event.LogEvent'])) { |
59 | 59 | $dic['Yapeal.Event.LogEvent'] = $dic->factory( |
60 | - function ($dic) { |
|
60 | + function($dic) { |
|
61 | 61 | return new $dic['Yapeal.Event.Factories.log']; |
62 | 62 | } |
63 | 63 | ); |
64 | 64 | } |
65 | 65 | if (empty($dic['Yapeal.Event.Mediator'])) { |
66 | - $dic['Yapeal.Event.Mediator'] = function ($dic) { |
|
66 | + $dic['Yapeal.Event.Mediator'] = function($dic) { |
|
67 | 67 | return new $dic['Yapeal.Event.mediator']($dic); |
68 | 68 | }; |
69 | 69 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function wire(ContainerInterface $dic) |
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Network.Client'])) { |
53 | - $dic['Yapeal.Network.Client'] = function ($dic) { |
|
53 | + $dic['Yapeal.Network.Client'] = function($dic) { |
|
54 | 54 | $appComment = $dic['Yapeal.Network.appComment']; |
55 | 55 | $appName = $dic['Yapeal.Network.appName']; |
56 | 56 | $appVersion = $dic['Yapeal.Network.appVersion']; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'Keep-Alive' => $dic['Yapeal.Network.Headers.Keep-Alive'] |
87 | 87 | ]; |
88 | 88 | // Clean up any extra spaces and EOL chars from Yaml. |
89 | - array_walk($headers, function (&$value) { |
|
89 | + array_walk($headers, function(&$value) { |
|
90 | 90 | /** @noinspection ReferenceMismatchInspection */ |
91 | 91 | return trim(str_replace(' ', '', $value)); |
92 | 92 | }); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | }; |
105 | 105 | } |
106 | 106 | if (empty($dic['Yapeal.Network.Retriever'])) { |
107 | - $dic['Yapeal.Network.Retriever'] = function ($dic) { |
|
107 | + $dic['Yapeal.Network.Retriever'] = function($dic) { |
|
108 | 108 | return new GuzzleNetworkRetriever($dic['Yapeal.Network.Client']); |
109 | 109 | }; |
110 | 110 | } |
@@ -54,19 +54,19 @@ discard block |
||
54 | 54 | { |
55 | 55 | if (empty($dic['Yapeal.Xsd.Creator'])) { |
56 | 56 | $dic['Yapeal.Xsd.Creator'] = $dic->factory( |
57 | - function ($dic) { |
|
57 | + function($dic) { |
|
58 | 58 | $loader = new Twig_Loader_Filesystem($dic['Yapeal.Xsd.dir']); |
59 | 59 | $twig = new Twig_Environment( |
60 | 60 | $loader, ['debug' => true, 'strict_variables' => true, 'autoescape' => false] |
61 | 61 | ); |
62 | 62 | $filter = new Twig_SimpleFilter( |
63 | - 'ucFirst', function ($value) { |
|
63 | + 'ucFirst', function($value) { |
|
64 | 64 | return ucfirst($value); |
65 | 65 | } |
66 | 66 | ); |
67 | 67 | $twig->addFilter($filter); |
68 | 68 | $filter = new Twig_SimpleFilter( |
69 | - 'lcFirst', function ($value) { |
|
69 | + 'lcFirst', function($value) { |
|
70 | 70 | return lcfirst($value); |
71 | 71 | } |
72 | 72 | ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | if (empty($dic['Yapeal.Xsd.Validator'])) { |
86 | 86 | $dic['Yapeal.Xsd.Validator'] = $dic->factory( |
87 | - function ($dic) { |
|
87 | + function($dic) { |
|
88 | 88 | return new $dic['Yapeal.Xsd.validate']($dic['Yapeal.Xsd.dir']); |
89 | 89 | } |
90 | 90 | ); |
@@ -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 | ); |