@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | try { |
| 83 | 83 | $this->files->getRequire($path, $data); |
| 84 | - } catch(Throwable $e) { |
|
| 84 | + } catch (Throwable $e) { |
|
| 85 | 85 | return $this->handleViewException($e, $obLevel); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | protected function handleViewException(Throwable $e, $obLevel) |
| 102 | 102 | { |
| 103 | - while(ob_get_level() > $obLevel) { |
|
| 103 | + while (ob_get_level() > $obLevel) { |
|
| 104 | 104 | ob_end_clean(); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | try { |
| 116 | 116 | $this->finder->find($view); |
| 117 | - } catch(InvalidArgumentException $e) { |
|
| 117 | + } catch (InvalidArgumentException $e) { |
|
| 118 | 118 | return false; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | 141 | // Loader class instance. |
| 142 | - return take($this->viewInstance($view, $path, $data), function ($view) { |
|
| 142 | + return take($this->viewInstance($view, $path, $data), function($view) { |
|
| 143 | 143 | $this->callCreator($view); |
| 144 | 144 | }); |
| 145 | 145 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->factory->flushStateIfDoneRendering(); |
| 121 | 121 | |
| 122 | 122 | return ! is_null($response) ? $response : $contents; |
| 123 | - } catch(Throwable $e) { |
|
| 123 | + } catch (Throwable $e) { |
|
| 124 | 124 | $this->factory->flushState(); |
| 125 | 125 | |
| 126 | 126 | throw $e; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | $data = array_merge($this->factory->getShared(), $this->data); |
| 164 | 164 | |
| 165 | - return array_map(function ($value) { |
|
| 165 | + return array_map(function($value) { |
|
| 166 | 166 | return ($value instanceof Renderable) ? $value->render() : $value; |
| 167 | 167 | }, $data); |
| 168 | 168 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function renderSections() |
| 178 | 178 | { |
| 179 | - return $this->render(function () { |
|
| 179 | + return $this->render(function() { |
|
| 180 | 180 | return $this->factory->getSections(); |
| 181 | 181 | }); |
| 182 | 182 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function bind($key, & $value) |
| 218 | 218 | { |
| 219 | - $this->data[$key] =& $value; |
|
| 219 | + $this->data[$key] = & $value; |
|
| 220 | 220 | |
| 221 | 221 | return $this; |
| 222 | 222 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function registerView() |
| 59 | 59 | { |
| 60 | - $this->app->singleton('view', function ($app) { |
|
| 60 | + $this->app->singleton('view', function($app) { |
|
| 61 | 61 | // The resolver will be used by an environment to get each of the various |
| 62 | 62 | // engine implementations such as plain PHP or Plaze engine. |
| 63 | 63 | $resolver = $app['view.engine.resolver']; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function registerViewFinder() |
| 86 | 86 | { |
| 87 | - $this->app->bind('view.finder', function ($app) { |
|
| 87 | + $this->app->bind('view.finder', function($app) { |
|
| 88 | 88 | return new FileViewFinder($app['files'], $app['config']['view.paths']); |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function registerPlazeTranspiler() |
| 98 | 98 | { |
| 99 | - $this->app->singleton('plaze.transpiler', function ($app) { |
|
| 99 | + $this->app->singleton('plaze.transpiler', function($app) { |
|
| 100 | 100 | return new PlazeTranspiler( |
| 101 | 101 | $app['files'], $app['config']['view.transpiled'] |
| 102 | 102 | ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function registerEngineResolver() |
| 113 | 113 | { |
| 114 | - $this->app->singleton('view.engine.resolver', function () { |
|
| 114 | + $this->app->singleton('view.engine.resolver', function() { |
|
| 115 | 115 | $resolver = new EngineResolver; |
| 116 | 116 | |
| 117 | 117 | // Register of the various view engines with the resolver |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function registerFileEngine($resolver) |
| 135 | 135 | { |
| 136 | - $resolver->register('file', function () { |
|
| 136 | + $resolver->register('file', function() { |
|
| 137 | 137 | return new FileEngine; |
| 138 | 138 | }); |
| 139 | 139 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function registerPhpEngine($resolver) |
| 149 | 149 | { |
| 150 | - $resolver->register('php', function () { |
|
| 150 | + $resolver->register('php', function() { |
|
| 151 | 151 | return new PhpEngine($this->app['files']); |
| 152 | 152 | }); |
| 153 | 153 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function registerPlazeEngine($resolver) |
| 163 | 163 | { |
| 164 | - $resolver->register('plaze', function () { |
|
| 164 | + $resolver->register('plaze', function() { |
|
| 165 | 165 | return new TranspilerEngine($this->app['plaze.transpiler'], $this->app['files']); |
| 166 | 166 | }); |
| 167 | 167 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]); |
| 73 | 73 | |
| 74 | - $callback = function ($matches) { |
|
| 74 | + $callback = function($matches) { |
|
| 75 | 75 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 76 | 76 | |
| 77 | 77 | return $matches[1] ? substr($matches[0], 1) : "<?php echo {$matches[2]}; ?>{$whitespace}"; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]); |
| 93 | 93 | |
| 94 | - $callback = function ($matches) { |
|
| 94 | + $callback = function($matches) { |
|
| 95 | 95 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 96 | 96 | |
| 97 | 97 | $wrapped = sprintf($this->echoFormat, $matches[2]); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]); |
| 115 | 115 | |
| 116 | - $callback = function ($matches) { |
|
| 116 | + $callback = function($matches) { |
|
| 117 | 117 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 118 | 118 | |
| 119 | 119 | return $matches[1] ? $matches[0] : "<?php echo e({$matches[2]}); ?>{$whitespace}"; |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | |
| 168 | 168 | if ( ! empty($file) || ! is_null($file)) { |
| 169 | 169 | $file = str_replace(['::', '.'], DIRECTORY_SEPARATOR, $file); |
| 170 | - } else { |
|
| 170 | + } else { |
|
| 171 | 171 | $file = $file ?: 'empty'; |
| 172 | 172 | |
| 173 | 173 | throw new InvalidArgumentException("File not found: [{$file}]"); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | function dd() |
| 71 | 71 | { |
| 72 | - array_map(function ($x) { |
|
| 72 | + array_map(function($x) { |
|
| 73 | 73 | var_dump($x); |
| 74 | 74 | }, func_get_args()); |
| 75 | 75 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | $uri = $this->trimUrl($root, $this->replaceRouteParameters($route->getRoute(), $parameters)); |
| 264 | 264 | |
| 265 | - return $forced ? $uri : '/' .ltrim(str_replace($root, '', $uri), '/'); |
|
| 265 | + return $forced ? $uri : '/'.ltrim(str_replace($root, '', $uri), '/'); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | protected function replaceNamedParameters($path, &$parameters) |
| 326 | 326 | { |
| 327 | - return preg_replace_callback('/\{(.*?)\??\}/', function ($match) use (&$parameters) { |
|
| 327 | + return preg_replace_callback('/\{(.*?)\??\}/', function($match) use (&$parameters) { |
|
| 328 | 328 | return isset($parameters[$match[1]]) ? Arr::pull($parameters, $match[1]) : $match[0]; |
| 329 | 329 | }, $path); |
| 330 | 330 | } |
@@ -339,7 +339,7 @@ |
||
| 339 | 339 | */ |
| 340 | 340 | protected function getNestedResourceUri(array $segments) |
| 341 | 341 | { |
| 342 | - return implode('/', array_map(function ($segment) { |
|
| 342 | + return implode('/', array_map(function($segment) { |
|
| 343 | 343 | return $segment.'/{'.$this->getResourceWilcard($segment).'}'; |
| 344 | 344 | }, $segments)); |
| 345 | 345 | } |