@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function create(string $view, $type = null): View |
| 111 | 111 | { |
| 112 | - if (!array_key_exists($view, $this->viewPathCache)) { |
|
| 112 | + if ( ! array_key_exists($view, $this->viewPathCache)) { |
|
| 113 | 113 | $uri = $this->scanLocations([$view]); |
| 114 | 114 | $engine = $uri ? $this->getEngine($uri) : false; |
| 115 | 115 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $this->viewPathCache[$view]['uri'] = $uri; |
| 118 | 118 | $this->viewPathCache[$view]['engine'] = $engine; |
| 119 | 119 | |
| 120 | - if ($type===null) { |
|
| 120 | + if ($type === null) { |
|
| 121 | 121 | $this->viewPathCache[$view]['view'] = $uri |
| 122 | 122 | ? $this->getView($uri, $engine) |
| 123 | 123 | : false; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| 131 | - if (!$uri || !$engine) { |
|
| 131 | + if ( ! $uri || ! $engine) { |
|
| 132 | 132 | return $this->getViewFinder()->getNullObject(); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | if (null === $type) { |
| 171 | 171 | $view = $this->getViewFinder()->find([$uri], $engine); |
| 172 | - return $view->setBuilder( $this ); |
|
| 172 | + return $view->setBuilder($this); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return $this->resolveType($type, $uri, $engine); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $this->locations->add($location); |
| 214 | 214 | |
| 215 | - unset( $this->viewPathCache ); |
|
| 215 | + unset($this->viewPathCache); |
|
| 216 | 216 | $this->viewPathCache = []; |
| 217 | 217 | |
| 218 | 218 | return $this; |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function scanLocations(array $criteria) |
| 243 | 243 | { |
| 244 | - $uris = $this->locations->map(function ($location) use ($criteria) { |
|
| 244 | + $uris = $this->locations->map(function($location) use ($criteria) { |
|
| 245 | 245 | /** @var Location $location */ |
| 246 | 246 | return $location->getURI($criteria); |
| 247 | - })->filter(function ($uri) { |
|
| 247 | + })->filter(function($uri) { |
|
| 248 | 248 | return false !== $uri; |
| 249 | 249 | }); |
| 250 | 250 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | $type = $type($uri, $engine, $this); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - if (! $type instanceof View) { |
|
| 307 | + if ( ! $type instanceof View) { |
|
| 308 | 308 | throw new FailedToInstantiateView( |
| 309 | 309 | sprintf( |
| 310 | 310 | _('Could not instantiate view "%s".'), |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | */ |
| 328 | 328 | protected function getConfig($config = []): ConfigInterface |
| 329 | 329 | { |
| 330 | - $defaults = ConfigFactory::create(dirname(__DIR__, 2) . '/config/defaults.php', $config); |
|
| 330 | + $defaults = ConfigFactory::create(dirname(__DIR__, 2).'/config/defaults.php', $config); |
|
| 331 | 331 | $config = $config |
| 332 | 332 | ? ConfigFactory::createFromArray(array_merge_recursive($defaults->getArrayCopy(), $config->getArrayCopy())) |
| 333 | 333 | : $defaults; |