@@ -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 | ); |
@@ -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; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (!empty($dic['Yapeal.Error.Logger'])) { |
54 | 54 | return $this; |
55 | 55 | } |
56 | - $dic['Yapeal.Error.Logger'] = function ($dic) { |
|
56 | + $dic['Yapeal.Error.Logger'] = function($dic) { |
|
57 | 57 | /** |
58 | 58 | * @var Logger $logger |
59 | 59 | */ |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $handler = new $dic['Yapeal.Error.Handlers.stream']('php://stderr', 100); |
70 | 70 | $group[] = $handler->setFormatter($lineFormatter); |
71 | 71 | } |
72 | - $handler = new $dic['Yapeal.Error.Handlers.stream']($dic['Yapeal.Error.dir'] . $dic['Yapeal.Error.fileName'], |
|
72 | + $handler = new $dic['Yapeal.Error.Handlers.stream']($dic['Yapeal.Error.dir'].$dic['Yapeal.Error.fileName'], |
|
73 | 73 | 100); |
74 | 74 | $group[] = $handler->setFormatter($lineFormatter); |
75 | 75 | $logger->pushHandler( |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function __construct($dir = __DIR__) |
55 | 55 | { |
56 | - $this->setRelativeBaseDir($dir . '/'); |
|
56 | + $this->setRelativeBaseDir($dir.'/'); |
|
57 | 57 | } |
58 | 58 | /** |
59 | 59 | * @param EveApiEventInterface $event |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | libxml_clear_errors(); |
98 | 98 | libxml_use_internal_errors($oldErrors); |
99 | 99 | $apiName = $data->getEveApiName(); |
100 | - $data->setEveApiName('Invalid_' . $apiName); |
|
100 | + $data->setEveApiName('Invalid_'.$apiName); |
|
101 | 101 | // Cache error XML. |
102 | 102 | $this->emitEvents($data, 'cache'); |
103 | 103 | $data->setEveApiName($apiName); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | if (!is_string($name)) { |
60 | - $mess = 'Name MUST be string but was given ' . gettype($name); |
|
60 | + $mess = 'Name MUST be string but was given '.gettype($name); |
|
61 | 61 | throw new InvalidArgumentException($mess); |
62 | 62 | } |
63 | 63 | $this->eveApiArguments[$name] = (string)$value; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $name = (string)$name; |
91 | 91 | if (!array_key_exists($name, $this->eveApiArguments)) { |
92 | - $mess = 'Unknown argument ' . $name; |
|
92 | + $mess = 'Unknown argument '.$name; |
|
93 | 93 | throw new DomainException($mess); |
94 | 94 | } |
95 | 95 | return $this->eveApiArguments[$name]; |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getHash() |
153 | 153 | { |
154 | - $hash = $this->getEveApiName() . $this->getEveApiSectionName(); |
|
154 | + $hash = $this->getEveApiName().$this->getEveApiSectionName(); |
|
155 | 155 | $arguments = $this->getEveApiArguments(); |
156 | 156 | ksort($arguments); |
157 | 157 | foreach ($arguments as $key => $value) { |
158 | 158 | if ('mask' === $key) { |
159 | 159 | continue; |
160 | 160 | } |
161 | - $hash .= $key . $value; |
|
161 | + $hash .= $key.$value; |
|
162 | 162 | } |
163 | 163 | return hash('md5', $hash); |
164 | 164 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function setEveApiName($value) |
229 | 229 | { |
230 | 230 | if (!is_string($value)) { |
231 | - $mess = 'Name MUST be string but was given ' . gettype($value); |
|
231 | + $mess = 'Name MUST be string but was given '.gettype($value); |
|
232 | 232 | throw new InvalidArgumentException($mess); |
233 | 233 | } |
234 | 234 | $this->eveApiName = $value; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | public function setEveApiSectionName($value) |
246 | 246 | { |
247 | 247 | if (!is_string($value)) { |
248 | - $mess = 'Section name MUST be string but was given ' . gettype($value); |
|
248 | + $mess = 'Section name MUST be string but was given '.gettype($value); |
|
249 | 249 | throw new InvalidArgumentException($mess); |
250 | 250 | } |
251 | 251 | $this->eveApiSectionName = $value; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $xml = ''; |
266 | 266 | } |
267 | 267 | if (!is_string($xml)) { |
268 | - $mess = 'Xml MUST be string but was given ' . gettype($xml); |
|
268 | + $mess = 'Xml MUST be string but was given '.gettype($xml); |
|
269 | 269 | throw new InvalidArgumentException($mess); |
270 | 270 | } |
271 | 271 | $this->eveApiXml = $xml; |