@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function __toString() |
69 | 69 | { |
70 | - if (! $this->isReadable()) { |
|
70 | + if (!$this->isReadable()) { |
|
71 | 71 | return ''; |
72 | 72 | } |
73 | 73 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function close() |
81 | 81 | { |
82 | - if (! $this->resource) { |
|
82 | + if (!$this->resource) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | public function attach($resource, $mode = 'r') |
117 | 117 | { |
118 | 118 | $error = null; |
119 | - if (! is_resource($resource) && is_string($resource)) { |
|
120 | - set_error_handler(function ($e) use (&$error) { |
|
119 | + if (!is_resource($resource) && is_string($resource)) { |
|
120 | + set_error_handler(function($e) use (&$error) { |
|
121 | 121 | $error = $e; |
122 | 122 | }, E_WARNING); |
123 | 123 | $resource = fopen($resource, $mode); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | throw new InvalidArgumentException('Invalid stream reference provided'); |
129 | 129 | } |
130 | 130 | |
131 | - if (! is_resource($resource)) { |
|
131 | + if (!is_resource($resource)) { |
|
132 | 132 | throw new InvalidArgumentException( |
133 | 133 | 'Invalid stream provided; must be a string stream identifier or resource' |
134 | 134 | ); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function tell() |
162 | 162 | { |
163 | - if (! $this->resource) { |
|
163 | + if (!$this->resource) { |
|
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function eof() |
176 | 176 | { |
177 | - if (! $this->resource) { |
|
177 | + if (!$this->resource) { |
|
178 | 178 | return true; |
179 | 179 | } |
180 | 180 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function isSeekable() |
190 | 190 | { |
191 | - if (! $this->resource) { |
|
191 | + if (!$this->resource) { |
|
192 | 192 | return false; |
193 | 193 | } |
194 | 194 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function seek($offset, $whence = SEEK_SET) |
216 | 216 | { |
217 | - if (! $this->resource || ! $this->isSeekable()) { |
|
217 | + if (!$this->resource || !$this->isSeekable()) { |
|
218 | 218 | return false; |
219 | 219 | } |
220 | 220 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function rewind() |
232 | 232 | { |
233 | - if (! $this->isSeekable()) { |
|
233 | + if (!$this->isSeekable()) { |
|
234 | 234 | return false; |
235 | 235 | } |
236 | 236 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function isWritable() |
248 | 248 | { |
249 | - if (! $this->resource) { |
|
249 | + if (!$this->resource) { |
|
250 | 250 | return false; |
251 | 251 | } |
252 | 252 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function write($string) |
267 | 267 | { |
268 | - if (! $this->resource) { |
|
268 | + if (!$this->resource) { |
|
269 | 269 | return false; |
270 | 270 | } |
271 | 271 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function isReadable() |
281 | 281 | { |
282 | - if (! $this->resource) { |
|
282 | + if (!$this->resource) { |
|
283 | 283 | return false; |
284 | 284 | } |
285 | 285 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function read($length) |
304 | 304 | { |
305 | - if (! $this->resource || ! $this->isReadable()) { |
|
305 | + if (!$this->resource || !$this->isReadable()) { |
|
306 | 306 | return false; |
307 | 307 | } |
308 | 308 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | public function getContents() |
322 | 322 | { |
323 | - if (! $this->isReadable()) { |
|
323 | + if (!$this->isReadable()) { |
|
324 | 324 | return ''; |
325 | 325 | } |
326 | 326 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } |
342 | 342 | |
343 | 343 | $metadata = stream_get_meta_data($this->resource); |
344 | - if (! array_key_exists($key, $metadata)) { |
|
344 | + if (!array_key_exists($key, $metadata)) { |
|
345 | 345 | return; |
346 | 346 | } |
347 | 347 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $serviceManager->setShared($name, $value); |
134 | 134 | } |
135 | 135 | |
136 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
136 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
137 | 137 | if ($instance instanceof EventManagerAwareInterface) { |
138 | 138 | if ($instance->getEventManager() instanceof EventManagerInterface) { |
139 | 139 | $instance->getEventManager()->setSharedManager( |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | } |
146 | 146 | }); |
147 | 147 | |
148 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
148 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
149 | 149 | if ($instance instanceof ServiceManagerAwareInterface) { |
150 | 150 | $instance->setServiceManager($serviceManager); |
151 | 151 | } |
152 | 152 | }); |
153 | 153 | |
154 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
154 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
155 | 155 | if ($instance instanceof ServiceLocatorAwareInterface) { |
156 | 156 | $instance->setServiceLocator($serviceManager); |
157 | 157 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $config = $serviceManager->get('Config'); |
47 | 47 | |
48 | - $options = array_merge(array( |
|
48 | + $options = array_merge(array( |
|
49 | 49 | 'auto_start' => false, |
50 | 50 | 'storage_id' => 'session.storage.native', |
51 | 51 | 'handler_id' => 'session.handler.native_file', |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // session handler |
70 | - $serviceManager->setFactory('session.handler', function ($serviceManager) use ($options) { |
|
70 | + $serviceManager->setFactory('session.handler', function($serviceManager) use ($options) { |
|
71 | 71 | $handlerID = $options['handler_id']; |
72 | 72 | |
73 | 73 | return $handlerID === null ? null : $serviceManager->get($handlerID); |
74 | 74 | }); |
75 | 75 | |
76 | 76 | // session storage native |
77 | - $serviceManager->setFactory('session.storage.native', function ($serviceManager) use ($storageOptions) { |
|
77 | + $serviceManager->setFactory('session.storage.native', function($serviceManager) use ($storageOptions) { |
|
78 | 78 | |
79 | 79 | // We need to strip out keys with a null value so symfony doesn't try and set things with a blank value |
80 | 80 | $storageOptions = array_filter($storageOptions); |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | }); |
84 | 84 | |
85 | 85 | // session flash bag |
86 | - $serviceManager->setFactory('session.flash_bag', function ($serviceManager) { |
|
86 | + $serviceManager->setFactory('session.flash_bag', function($serviceManager) { |
|
87 | 87 | return new FlashBag(); |
88 | 88 | }); |
89 | 89 | |
90 | 90 | // session attribute bag |
91 | - $serviceManager->setFactory('session.attribute_bag', function ($serviceManager) { |
|
91 | + $serviceManager->setFactory('session.attribute_bag', function($serviceManager) { |
|
92 | 92 | return new AttributeBag(); |
93 | 93 | }); |
94 | 94 | |
95 | 95 | $that = $this; |
96 | 96 | |
97 | 97 | // session handler native file |
98 | - $serviceManager->setFactory('session.handler.native_file', function ($serviceManager) use ($that, $storageOptions) { |
|
98 | + $serviceManager->setFactory('session.handler.native_file', function($serviceManager) use ($that, $storageOptions) { |
|
99 | 99 | |
100 | 100 | // We want absolute paths if we can |
101 | 101 | if (null !== $storageOptions['save_path'] && !$that->isAbsolutePath($storageOptions['save_path'])) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | }); |
113 | 113 | |
114 | 114 | // session |
115 | - $serviceManager->setFactory('session', function ($serviceManager) { |
|
115 | + $serviceManager->setFactory('session', function($serviceManager) { |
|
116 | 116 | |
117 | 117 | $session = new Session( |
118 | 118 | $serviceManager->get('session.storage.native'), |
@@ -48,8 +48,7 @@ |
||
48 | 48 | $parametersBag = $serviceLocator->get('ApplicationParameters'); |
49 | 49 | |
50 | 50 | $config['parameters'] = isset($config['parameters']) ? |
51 | - ArrayUtils::merge($parametersBag->all(), $config['parameters']) : |
|
52 | - $config['parameters'] = $parametersBag->all(); |
|
51 | + ArrayUtils::merge($parametersBag->all(), $config['parameters']) : $config['parameters'] = $parametersBag->all(); |
|
53 | 52 | |
54 | 53 | return $parametersBag->resolveArray($config); |
55 | 54 | } |
@@ -61,7 +61,6 @@ |
||
61 | 61 | $defaults = $defaults['framework']['router']; |
62 | 62 | |
63 | 63 | return isset($config['framework']['router']) ? |
64 | - $this->mergeConfiguration($defaults, $config['framework']['router']) : |
|
65 | - $defaults; |
|
64 | + $this->mergeConfiguration($defaults, $config['framework']['router']) : $defaults; |
|
66 | 65 | } |
67 | 66 | } |
@@ -53,9 +53,9 @@ |
||
53 | 53 | // this throws an exception if there is no such module |
54 | 54 | $msg = sprintf('Unable to find controller "%s:%s" - module alias "%s" does not exist.', $moduleName, $controller, $moduleAlias); |
55 | 55 | } else { |
56 | - $class = $module->getNamespace() . '\\Controller\\' . $controller; |
|
56 | + $class = $module->getNamespace().'\\Controller\\'.$controller; |
|
57 | 57 | if (class_exists($class)) { |
58 | - return $class . '::' . $action . 'Action'; |
|
58 | + return $class.'::'.$action.'Action'; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $msg = sprintf('Unable to find controller "%s:%s" - class "%s" does not exist.', $moduleName, $controller, $class); |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | $files = array(); |
89 | 89 | |
90 | 90 | foreach ($modules as $module) { |
91 | - if ($isResource && file_exists($file = $dir . '/' . $module->getName() . $overridePath)) { |
|
91 | + if ($isResource && file_exists($file = $dir.'/'.$module->getName().$overridePath)) { |
|
92 | 92 | if (null !== $resourceModule) { |
93 | 93 | throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived module. Create a "%s" file to override the module resource.', |
94 | 94 | $file, |
95 | 95 | $resourceModule, |
96 | - $dir . '/' . $modules[0]->getName() . $overridePath |
|
96 | + $dir.'/'.$modules[0]->getName().$overridePath |
|
97 | 97 | )); |
98 | 98 | } |
99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $files[] = $file; |
104 | 104 | } |
105 | 105 | |
106 | - if (file_exists($file = $this->getResourcesPath($module) . '/' . $path)) { |
|
106 | + if (file_exists($file = $this->getResourcesPath($module).'/'.$path)) { |
|
107 | 107 | if ($first && !$isResource) { |
108 | 108 | return $file; |
109 | 109 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | protected function getResourcesPath($module) |
123 | 123 | { |
124 | 124 | if (is_callable(array($module, 'getResourcesPath'))) { |
125 | - $resourcesPath = $module->getResourcesPath(); |
|
125 | + $resourcesPath = $module->getResourcesPath(); |
|
126 | 126 | } else { |
127 | 127 | $resourcesPath = $module->getPath(); |
128 | 128 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | protected function helper($helperName) |
82 | 82 | { |
83 | 83 | if (!isset($this->helpers[$helperName])) { |
84 | - throw new \InvalidArgumentException('Unable to locate controller helper: ' . $helperName); |
|
84 | + throw new \InvalidArgumentException('Unable to locate controller helper: '.$helperName); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return $this->helpers[$helperName]; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $loader = new YamlFileLoader(new FileLocator(array(dirname($path)))); |
83 | 83 | $loader->setDefaults(array('_module' => $this->getName())); |
84 | 84 | |
85 | - $routesCollection = $loader->load(pathinfo($path, PATHINFO_FILENAME) . '.' . pathinfo($path, PATHINFO_EXTENSION)); |
|
85 | + $routesCollection = $loader->load(pathinfo($path, PATHINFO_FILENAME).'.'.pathinfo($path, PATHINFO_EXTENSION)); |
|
86 | 86 | $this->routes = $routesCollection; |
87 | 87 | } |
88 | 88 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | $routeCollector = new \FastRoute\RouteCollector($routeParser, $dataGenerator); |
133 | 133 | |
134 | 134 | if (!is_readable($path)) { |
135 | - throw new \InvalidArgumentException('Invalid fast route routes path found: ' . $path); |
|
135 | + throw new \InvalidArgumentException('Invalid fast route routes path found: '.$path); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | // The included file must return the laravel router |
139 | - $getRouteCollector = function () use ($routeCollector, $path) { |
|
139 | + $getRouteCollector = function() use ($routeCollector, $path) { |
|
140 | 140 | $r = $routeCollector; |
141 | 141 | include $path; |
142 | 142 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | protected function loadAuraRoutes($path) |
174 | 174 | { |
175 | 175 | if (!is_readable($path)) { |
176 | - throw new \InvalidArgumentException('Invalid aura routes path found: ' . $path); |
|
176 | + throw new \InvalidArgumentException('Invalid aura routes path found: '.$path); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $router = (new AuraRouterFactory())->newInstance(); |
@@ -377,13 +377,13 @@ discard block |
||
377 | 377 | $finder = new Finder(); |
378 | 378 | $finder->files()->name('*Command.php')->in($dir); |
379 | 379 | |
380 | - $prefix = $this->getNamespace() . '\\Command'; |
|
380 | + $prefix = $this->getNamespace().'\\Command'; |
|
381 | 381 | foreach ($finder as $file) { |
382 | 382 | $ns = $prefix; |
383 | 383 | if ($relativePath = $file->getRelativePath()) { |
384 | - $ns .= '\\' . strtr($relativePath, '/', '\\'); |
|
384 | + $ns .= '\\'.strtr($relativePath, '/', '\\'); |
|
385 | 385 | } |
386 | - $r = new \ReflectionClass($ns . '\\' . $file->getBasename('.php')); |
|
386 | + $r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php')); |
|
387 | 387 | if ($r->isSubclassOf('PPI\Framework\\Console\\Command\\AbstractCommand') && !$r->isAbstract()) { |
388 | 388 | $application->add($r->newInstance()); |
389 | 389 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | protected function getConfigLoader() |
399 | 399 | { |
400 | 400 | if (null === $this->configLoader) { |
401 | - $this->configLoader = new ConfigLoader($this->getPath() . '/resources/config'); |
|
401 | + $this->configLoader = new ConfigLoader($this->getPath().'/resources/config'); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | return $this->configLoader; |