@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function render($uri, array $context = []) |
| 58 | 58 | { |
| 59 | - if (! is_readable($uri)) { |
|
| 59 | + if ( ! is_readable($uri)) { |
|
| 60 | 60 | throw new FailedToLoadViewException( |
| 61 | 61 | sprintf( |
| 62 | 62 | _('The View URI "%1$s" is not accessible or readable.'), |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public static function getDefaultConfig() |
| 91 | 91 | { |
| 92 | - return ConfigFactory::create(__DIR__ . '/../config/defaults.php') |
|
| 92 | + return ConfigFactory::create(__DIR__.'/../config/defaults.php') |
|
| 93 | 93 | ->getSubConfig('BrightNucleus\View'); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @since 0.1.0 |
| 92 | 92 | * |
| 93 | 93 | * @param string $view View identifier to create a view for. |
| 94 | - * @param mixed $type Type of view to create. |
|
| 94 | + * @param string|null $type Type of view to create. |
|
| 95 | 95 | * |
| 96 | 96 | * @return ViewInterface Instance of the requested view. |
| 97 | 97 | */ |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * |
| 191 | 191 | * @since 0.1.0 |
| 192 | 192 | * |
| 193 | - * @param array $criteria Criteria to match. |
|
| 193 | + * @param string[] $criteria Criteria to match. |
|
| 194 | 194 | * |
| 195 | 195 | * @return string|false URI of the requested view, or false if not found. |
| 196 | 196 | */ |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function scanLocations(array $criteria) |
| 191 | 191 | { |
| 192 | - return $this->locations->map(function ($location) use ($criteria) { |
|
| 192 | + return $this->locations->map(function($location) use ($criteria) { |
|
| 193 | 193 | /** @var LocationInterface $location */ |
| 194 | 194 | return $location->getURI($criteria); |
| 195 | - })->filter(function ($uri) { |
|
| 195 | + })->filter(function($uri) { |
|
| 196 | 196 | return false !== $uri; |
| 197 | 197 | })->first() ?: false; |
| 198 | 198 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $type = $type($uri, $engine); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - if (! $type instanceof ViewInterface) { |
|
| 249 | + if ( ! $type instanceof ViewInterface) { |
|
| 250 | 250 | throw new FailedToInstantiateViewException( |
| 251 | 251 | sprintf( |
| 252 | 252 | _('Could not instantiate view "%s".'), |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function render(array $context = [], $echo = false) |
| 38 | 38 | { |
| 39 | - if (! $echo) { |
|
| 39 | + if ( ! $echo) { |
|
| 40 | 40 | return ''; |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | foreach ($criteria as $entry) { |
| 94 | 94 | if ($uri = $this->transform($entry, false)) { |
| 95 | - $uris = array_merge($uris, (array)$uri); |
|
| 95 | + $uris = array_merge($uris, (array) $uri); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function validateExtensions($extensions) |
| 112 | 112 | { |
| 113 | - if (! $extensions instanceof ExtensionCollection) { |
|
| 114 | - $extensions = new ExtensionCollection((array)$extensions); |
|
| 113 | + if ( ! $extensions instanceof ExtensionCollection) { |
|
| 114 | + $extensions = new ExtensionCollection((array) $extensions); |
|
| 115 | 115 | } |
| 116 | 116 | $extensions->add(''); |
| 117 | 117 | |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | { |
| 165 | 165 | $variants = []; |
| 166 | 166 | |
| 167 | - $this->extensions->map(function ($extension) use ($entry, &$variants) { |
|
| 168 | - $variants[] = $entry . $extension; |
|
| 169 | - $variants[] = $this->path . DIRECTORY_SEPARATOR . $entry . $extension; |
|
| 167 | + $this->extensions->map(function($extension) use ($entry, &$variants) { |
|
| 168 | + $variants[] = $entry.$extension; |
|
| 169 | + $variants[] = $this->path.DIRECTORY_SEPARATOR.$entry.$extension; |
|
| 170 | 170 | }); |
| 171 | 171 | |
| 172 | 172 | return $variants; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | protected function initializeFindables($arguments = null) |
| 152 | 152 | { |
| 153 | - $this->findables = $this->findables->map(function ($findable) use ($arguments) { |
|
| 153 | + $this->findables = $this->findables->map(function($findable) use ($arguments) { |
|
| 154 | 154 | return $this->initializeFindable($findable, $arguments); |
| 155 | 155 | }); |
| 156 | 156 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $findable = $this->instantiateFindableFromCallable($findable, $arguments); |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - if (! $findable instanceof Findable) { |
|
| 194 | + if ( ! $findable instanceof Findable) { |
|
| 195 | 195 | throw new FailedToInstantiateFindableException( |
| 196 | 196 | sprintf( |
| 197 | 197 | _('Could not instantiate Findable "%s".'), |