| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | * @param string $uri URI to render. | 
| 52 | 52 | * @param array $context Context in which to render. | 
| 53 | 53 | * | 
| 54 | - * @return callable Rendering callback. | |
| 54 | + * @return \Closure Rendering callback. | |
| 55 | 55 | * @throws FailedToLoadView If the View URI is not accessible or readable. | 
| 56 | 56 | * @throws FailedToLoadView If the View URI could not be loaded. | 
| 57 | 57 | */ | 
| @@ -66,7 +66,7 @@ | ||
| 66 | 66 | ); | 
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | -        $closure = function () use ($uri, $context) { | |
| 69 | +        $closure = function() use ($uri, $context) { | |
| 70 | 70 | |
| 71 | 71 | // Save current buffering level so we can backtrack in case of an error. | 
| 72 | 72 | // This is needed because the view itself might also add an unknown number of output buffering levels. | 
| @@ -94,7 +94,7 @@ discard block | ||
| 94 | 94 | * @since 0.1.0 | 
| 95 | 95 | * | 
| 96 | 96 | * @param string $view View identifier to create a view for. | 
| 97 | - * @param mixed $type Type of view to create. | |
| 97 | + * @param string|null $type Type of view to create. | |
| 98 | 98 | * | 
| 99 | 99 | * @return View Instance of the requested view. | 
| 100 | 100 | */ | 
| @@ -195,7 +195,7 @@ discard block | ||
| 195 | 195 | * | 
| 196 | 196 | * @since 0.1.0 | 
| 197 | 197 | * | 
| 198 | - * @param array $criteria Criteria to match. | |
| 198 | + * @param string[] $criteria Criteria to match. | |
| 199 | 199 | * | 
| 200 | 200 | * @return string|false URI of the requested view, or false if not found. | 
| 201 | 201 | */ | 
| @@ -277,6 +277,7 @@ discard block | ||
| 277 | 277 | * | 
| 278 | 278 | * @since 0.2.0 | 
| 279 | 279 | * | 
| 280 | + * @param ConfigInterface $config | |
| 280 | 281 | * @return ConfigInterface Configuration passed in through the constructor. | 
| 281 | 282 | */ | 
| 282 | 283 | protected function getConfig($config = null) | 
| @@ -201,10 +201,10 @@ discard block | ||
| 201 | 201 | */ | 
| 202 | 202 | public function scanLocations(array $criteria) | 
| 203 | 203 |      { | 
| 204 | -        $uris = $this->locations->map(function ($location) use ($criteria) { | |
| 204 | +        $uris = $this->locations->map(function($location) use ($criteria) { | |
| 205 | 205 | /** @var Location $location */ | 
| 206 | 206 | return $location->getURI($criteria); | 
| 207 | -        })->filter(function ($uri) { | |
| 207 | +        })->filter(function($uri) { | |
| 208 | 208 | return false !== $uri; | 
| 209 | 209 | }); | 
| 210 | 210 | |
| @@ -281,7 +281,7 @@ discard block | ||
| 281 | 281 | */ | 
| 282 | 282 | protected function getConfig($config = null) | 
| 283 | 283 |      { | 
| 284 | - $defaults = ConfigFactory::create(__DIR__ . '/../../config/defaults.php', $config); | |
| 284 | + $defaults = ConfigFactory::create(__DIR__.'/../../config/defaults.php', $config); | |
| 285 | 285 | $config = $config | 
| 286 | 286 | ? ConfigFactory::createFromArray(array_merge_recursive($defaults->getArrayCopy(), $config->getArrayCopy())) | 
| 287 | 287 | : $defaults; | 
| @@ -124,12 +124,12 @@ discard block | ||
| 124 | 124 |      { | 
| 125 | 125 | $names = []; | 
| 126 | 126 | |
| 127 | -        $names[] = array_map(function ($criterion) use ($extension) { | |
| 127 | +        $names[] = array_map(function($criterion) use ($extension) { | |
| 128 | 128 | $criterion = URIHelper::getFilename($criterion); | 
| 129 | 129 | |
| 130 | 130 | return empty($extension) || URIHelper::hasExtension($criterion, $extension) | 
| 131 | 131 | ? $criterion | 
| 132 | - : $criterion . $extension; | |
| 132 | + : $criterion.$extension; | |
| 133 | 133 | }, $criteria)[0]; | 
| 134 | 134 | |
| 135 | 135 | return $this->arrayToRegexPattern(array_unique($names)); | 
| @@ -158,11 +158,11 @@ discard block | ||
| 158 | 158 | */ | 
| 159 | 159 | protected function arrayToRegexPattern(array $array) | 
| 160 | 160 |      { | 
| 161 | -        $array = array_map(function ($entry) { | |
| 161 | +        $array = array_map(function($entry) { | |
| 162 | 162 | return preg_quote($entry); | 
| 163 | 163 | }, $array); | 
| 164 | 164 | |
| 165 | -        return '/' . implode('|', $array) . '/'; | |
| 165 | +        return '/'.implode('|', $array).'/'; | |
| 166 | 166 | } | 
| 167 | 167 | |
| 168 | 168 | /** | 
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 |          if ( ! $extensions instanceof Extensions) { | 
| 184 | - $extensions = new Extensions((array)$extensions); | |
| 184 | + $extensions = new Extensions((array) $extensions); | |
| 185 | 185 | } | 
| 186 | 186 | |
| 187 | 187 | return $extensions; | 
| @@ -65,7 +65,7 @@ | ||
| 65 | 65 | ); | 
| 66 | 66 | } | 
| 67 | 67 | |
| 68 | -        return $this->exists(function ($key, $element) use ($location) { | |
| 68 | +        return $this->exists(function($key, $element) use ($location) { | |
| 69 | 69 | return $location == $element; | 
| 70 | 70 | }); | 
| 71 | 71 | } | 
| @@ -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 | } | 
| @@ -215,7 +215,7 @@ discard block | ||
| 215 | 215 | */ | 
| 216 | 216 | protected function instantiateFindableFromString($string, $arguments = []) | 
| 217 | 217 |      { | 
| 218 | - return new $string(...(array)$arguments); | |
| 218 | + return new $string(...(array) $arguments); | |
| 219 | 219 | } | 
| 220 | 220 | |
| 221 | 221 | /** | 
| @@ -230,6 +230,6 @@ discard block | ||
| 230 | 230 | */ | 
| 231 | 231 | protected function instantiateFindableFromCallable($callable, $arguments = []) | 
| 232 | 232 |      { | 
| 233 | - return $callable(...(array)$arguments); | |
| 233 | + return $callable(...(array) $arguments); | |
| 234 | 234 | } | 
| 235 | 235 | } |