@@ -49,13 +49,13 @@ |
||
49 | 49 | public function wire(ContainerInterface $dic) |
50 | 50 | { |
51 | 51 | if (empty($dic['Yapeal.FileSystem.CachePreserver'])) { |
52 | - $dic['Yapeal.FileSystem.CachePreserver'] = function () use ($dic) { |
|
52 | + $dic['Yapeal.FileSystem.CachePreserver'] = function() use ($dic) { |
|
53 | 53 | return new $dic['Yapeal.FileSystem.Handlers.preserve']($dic['Yapeal.FileSystem.Cache.dir'], |
54 | 54 | $dic['Yapeal.FileSystem.Cache.preserve']); |
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.FileSystem.Handlers.retrieve']($dic['Yapeal.FileSystem.Cache.dir'], |
60 | 60 | $dic['Yapeal.FileSystem.Cache.retrieve']); |
61 | 61 | }; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | public function setCachePath($value = null) |
104 | 104 | { |
105 | 105 | if ($value === null) { |
106 | - $value = dirname(dirname(__DIR__)) . '/cache/'; |
|
106 | + $value = dirname(dirname(__DIR__)).'/cache/'; |
|
107 | 107 | } |
108 | 108 | if (!is_string($value)) { |
109 | - $mess = 'Cache path MUST be string, but was given ' . gettype($value); |
|
109 | + $mess = 'Cache path MUST be string, but was given '.gettype($value); |
|
110 | 110 | throw new \InvalidArgumentException($mess); |
111 | 111 | } |
112 | 112 | $this->cachePath = $this->getFpn() |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | return true; |
170 | 170 | } |
171 | 171 | $now = time(); |
172 | - $current = strtotime($current . '+00:00'); |
|
173 | - $until = strtotime($until . '+00:00'); |
|
172 | + $current = strtotime($current.'+00:00'); |
|
173 | + $until = strtotime($until.'+00:00'); |
|
174 | 174 | // At minimum use cached XML for 5 minutes (300 secs). |
175 | 175 | if (($now - $current) <= 300) { |
176 | 176 | return false; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function wire(ContainerInterface $dic) |
50 | 50 | { |
51 | 51 | if (empty($dic['Yapeal.Network.Client'])) { |
52 | - $dic['Yapeal.Network.Client'] = function ($dic) { |
|
52 | + $dic['Yapeal.Network.Client'] = function($dic) { |
|
53 | 53 | $appComment = $dic['Yapeal.Network.appComment']; |
54 | 54 | $appName = $dic['Yapeal.Network.appName']; |
55 | 55 | $appVersion = $dic['Yapeal.Network.appVersion']; |
@@ -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 | if ('' !== $userAgent) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | }; |
97 | 97 | } |
98 | 98 | if (empty($dic['Yapeal.Network.Retriever'])) { |
99 | - $dic['Yapeal.Network.Retriever'] = function ($dic) { |
|
99 | + $dic['Yapeal.Network.Retriever'] = function($dic) { |
|
100 | 100 | return new $dic['Yapeal.Network.Handlers.retrieve']($dic['Yapeal.Network.Client'], |
101 | 101 | $dic['Yapeal.Network.Cache:retrieve']); |
102 | 102 | }; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | throw new \InvalidArgumentException('Extension service definition is not a Closure or invokable object.'); |
88 | 88 | } |
89 | 89 | $factory = $this->values[$id]; |
90 | - $extended = function ($c) use ($callable, $factory) { |
|
90 | + $extended = function($c) use ($callable, $factory) { |
|
91 | 91 | return $callable($factory($c), $c); |
92 | 92 | }; |
93 | 93 | if (isset($this->factories[$factory])) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $attributes['ownerID'] = '$ownerID'; |
164 | 164 | } |
165 | 165 | uksort($attributes, |
166 | - function ($alpha, $beta) { |
|
166 | + function($alpha, $beta) { |
|
167 | 167 | return strtolower($alpha) <=> strtolower($beta); |
168 | 168 | }); |
169 | 169 | if (0 === count($this->tables)) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $values['ownerID'] = '$ownerID'; |
200 | 200 | } |
201 | 201 | uksort($values, |
202 | - function ($alpha, $beta) { |
|
202 | + function($alpha, $beta) { |
|
203 | 203 | return strtolower($alpha) <=> strtolower($beta); |
204 | 204 | }); |
205 | 205 | $this->tables[$tableName] = ['values' => $values]; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | private function getNamespace(): string |
211 | 211 | { |
212 | - return 'Yapeal\EveApi\\' . ucfirst($this->sectionName); |
|
212 | + return 'Yapeal\EveApi\\'.ucfirst($this->sectionName); |
|
213 | 213 | } |
214 | 214 | /** |
215 | 215 | * Used to determine if API is in section that has an owner. |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | basename(dirname($listener)), |
68 | 68 | basename($listener, '.php')); |
69 | 69 | if (empty($dic[$service])) { |
70 | - $dic[$service] = function () use ($dic, $service) { |
|
71 | - $class = '\\' . str_replace('.', '\\', $service); |
|
70 | + $dic[$service] = function() use ($dic, $service) { |
|
71 | + $class = '\\'.str_replace('.', '\\', $service); |
|
72 | 72 | /** |
73 | 73 | * @var \Yapeal\CommonToolsInterface $callable |
74 | 74 | */ |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | return $callable; |
85 | 85 | }; |
86 | 86 | } |
87 | - $mediator->addServiceListener($service . '.start', [$service, 'startEveApi'], 'last'); |
|
87 | + $mediator->addServiceListener($service.'.start', [$service, 'startEveApi'], 'last'); |
|
88 | 88 | if (false === strpos($listener, 'Section')) { |
89 | - $mediator->addServiceListener($service . '.preserve', [$service, 'preserveEveApi'], 'last'); |
|
89 | + $mediator->addServiceListener($service.'.preserve', [$service, 'preserveEveApi'], 'last'); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $rdi->setFlags($flags); |
108 | 108 | /** @noinspection SpellCheckingInspection */ |
109 | 109 | $rcfi = new \RecursiveCallbackFilterIterator($rdi, |
110 | - function (\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
110 | + function(\SplFileInfo $current, $key, \RecursiveDirectoryIterator $rdi) { |
|
111 | 111 | if ($rdi->hasChildren()) { |
112 | 112 | return true; |
113 | 113 | } |
@@ -134,15 +134,15 @@ discard block |
||
134 | 134 | private function wireCreator(ContainerInterface $dic, MediatorInterface $mediator) |
135 | 135 | { |
136 | 136 | if (empty($dic['Yapeal.EveApi.Creator'])) { |
137 | - $dic['Yapeal.EveApi.Creator'] = function () use ($dic) { |
|
137 | + $dic['Yapeal.EveApi.Creator'] = function() use ($dic) { |
|
138 | 138 | $loader = new \Twig_Loader_Filesystem($dic['Yapeal.EveApi.dir']); |
139 | 139 | $twig = new \Twig_Environment($loader, |
140 | 140 | ['debug' => true, 'strict_variables' => true, 'autoescape' => false]); |
141 | - $filter = new \Twig_SimpleFilter('ucFirst', function ($value) { |
|
141 | + $filter = new \Twig_SimpleFilter('ucFirst', function($value) { |
|
142 | 142 | return ucfirst($value); |
143 | 143 | }); |
144 | 144 | $twig->addFilter($filter); |
145 | - $filter = new \Twig_SimpleFilter('lcFirst', function ($value) { |
|
145 | + $filter = new \Twig_SimpleFilter('lcFirst', function($value) { |
|
146 | 146 | return lcfirst($value); |
147 | 147 | }); |
148 | 148 | $twig->addFilter($filter); |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | public function wire(ContainerInterface $dic) |
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Xsd.Creator'])) { |
53 | - $dic['Yapeal.Xsd.Creator'] = function () use ($dic) { |
|
53 | + $dic['Yapeal.Xsd.Creator'] = function() use ($dic) { |
|
54 | 54 | $loader = new \Twig_Loader_Filesystem($dic['Yapeal.Xsd.dir']); |
55 | 55 | $twig = new \Twig_Environment($loader, |
56 | 56 | ['debug' => true, 'strict_variables' => true, 'autoescape' => false]); |
57 | - $filter = new \Twig_SimpleFilter('ucFirst', function ($value) { |
|
57 | + $filter = new \Twig_SimpleFilter('ucFirst', function($value) { |
|
58 | 58 | return ucfirst($value); |
59 | 59 | }); |
60 | 60 | $twig->addFilter($filter); |
61 | - $filter = new \Twig_SimpleFilter('lcFirst', function ($value) { |
|
61 | + $filter = new \Twig_SimpleFilter('lcFirst', function($value) { |
|
62 | 62 | return lcfirst($value); |
63 | 63 | }); |
64 | 64 | $twig->addFilter($filter); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | }; |
74 | 74 | } |
75 | 75 | if (empty($dic['Yapeal.Xsd.Validator'])) { |
76 | - $dic['Yapeal.Xsd.Validator'] = function () use ($dic) { |
|
76 | + $dic['Yapeal.Xsd.Validator'] = function() use ($dic) { |
|
77 | 77 | return new $dic['Yapeal.Xsd.Handlers.validate']($dic['Yapeal.Xsd.dir']); |
78 | 78 | }; |
79 | 79 | } |
@@ -50,12 +50,12 @@ |
||
50 | 50 | public function wire(ContainerInterface $dic) |
51 | 51 | { |
52 | 52 | if (empty($dic['Yapeal.Xml.Data'])) { |
53 | - $dic['Yapeal.Xml.Data'] = $dic->factory(function ($dic) { |
|
53 | + $dic['Yapeal.Xml.Data'] = $dic->factory(function($dic) { |
|
54 | 54 | return new $dic['Yapeal.Xml.Handlers.data'](); |
55 | 55 | }); |
56 | 56 | } |
57 | 57 | if (empty($dic['Yapeal.Xml.Error.Subscriber'])) { |
58 | - $dic['Yapeal.Xml.Error.Subscriber'] = function () use ($dic) { |
|
58 | + $dic['Yapeal.Xml.Error.Subscriber'] = function() use ($dic) { |
|
59 | 59 | return new $dic['Yapeal.Xml.Handlers.error'](); |
60 | 60 | }; |
61 | 61 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @var WiringInterface $class |
103 | 103 | */ |
104 | 104 | foreach ($names as $name) { |
105 | - $setting = $base . strtolower($name); |
|
105 | + $setting = $base.strtolower($name); |
|
106 | 106 | if (!empty($dic[$setting]) |
107 | 107 | && is_subclass_of($dic[$setting], '\\Yapeal\\Configuration\\WiringInterface', true) |
108 | 108 | ) { |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | $class->wire($dic); |
111 | 111 | continue; |
112 | 112 | } |
113 | - $methodName = 'wire' . $name; |
|
113 | + $methodName = 'wire'.$name; |
|
114 | 114 | if (method_exists($this, $methodName)) { |
115 | 115 | $this->$methodName(); |
116 | 116 | } else { |
117 | - $mess = 'Could NOT find class or method for ' . $name; |
|
117 | + $mess = 'Could NOT find class or method for '.$name; |
|
118 | 118 | throw new \LogicException($mess); |
119 | 119 | } |
120 | 120 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $dic = $this->dic; |
138 | 138 | do { |
139 | 139 | $settings = preg_replace_callback($regEx, |
140 | - function ($match) use ($settings, $dic) { |
|
140 | + function($match) use ($settings, $dic) { |
|
141 | 141 | if (!empty($settings[$match['name']])) { |
142 | 142 | return $settings[$match['name']]; |
143 | 143 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if (PREG_NO_ERROR !== $lastError) { |
158 | 158 | $constants = array_flip(get_defined_constants(true)['pcre']); |
159 | 159 | $lastError = $constants[$lastError]; |
160 | - $mess = 'Received preg error ' . $lastError; |
|
160 | + $mess = 'Received preg error '.$lastError; |
|
161 | 161 | throw new \DomainException($mess); |
162 | 162 | } |
163 | 163 | } while ($count > 0); |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | $dic['Yapeal.baseDir'] = $path; |
178 | 178 | } |
179 | 179 | if (empty($dic['Yapeal.libDir'])) { |
180 | - $dic['Yapeal.libDir'] = $path . 'lib/'; |
|
180 | + $dic['Yapeal.libDir'] = $path.'lib/'; |
|
181 | 181 | } |
182 | 182 | $configFiles = [ |
183 | - $fpn->normalizeFile(__DIR__ . '/yapeal_defaults.yaml'), |
|
184 | - $fpn->normalizeFile($dic['Yapeal.baseDir'] . 'config/yapeal.yaml') |
|
183 | + $fpn->normalizeFile(__DIR__.'/yapeal_defaults.yaml'), |
|
184 | + $fpn->normalizeFile($dic['Yapeal.baseDir'].'config/yapeal.yaml') |
|
185 | 185 | ]; |
186 | 186 | $vendorPos = strpos($path, 'vendor/'); |
187 | 187 | if (false !== $vendorPos) { |
188 | 188 | $dic['Yapeal.vendorParentDir'] = substr($path, 0, $vendorPos); |
189 | - $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'); |
|
189 | + $configFiles[] = $fpn->normalizeFile($dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'); |
|
190 | 190 | } |
191 | 191 | $settings = []; |
192 | 192 | // Process each file in turn so any substitutions are done in a more |