@@ -119,7 +119,7 @@ |
||
| 119 | 119 | * @param array $context Optional. The context in which to render the view. |
| 120 | 120 | * @param string|null $type Type of view to create. |
| 121 | 121 | * |
| 122 | - * @return ViewInterface Instance of the requested view. |
|
| 122 | + * @return string Instance of the requested view. |
|
| 123 | 123 | */ |
| 124 | 124 | public static function render($view, array $context = [], $type = null) |
| 125 | 125 | { |
@@ -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 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | * |
| 84 | 84 | * @param string $entry Entry to transform. |
| 85 | 85 | * |
| 86 | - * @return string|bool URI of the view, or false if none found. |
|
| 86 | + * @return string|false URI of the view, or false if none found. |
|
| 87 | 87 | */ |
| 88 | 88 | protected function transform($entry) |
| 89 | 89 | { |
@@ -90,12 +90,12 @@ |
||
| 90 | 90 | try { |
| 91 | 91 | foreach ($this->extensions as $extension) { |
| 92 | 92 | |
| 93 | - $uri = $entry . $extension; |
|
| 93 | + $uri = $entry.$extension; |
|
| 94 | 94 | if (is_readable($uri)) { |
| 95 | 95 | return $uri; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $uri = $this->path . DIRECTORY_SEPARATOR . $uri; |
|
| 98 | + $uri = $this->path.DIRECTORY_SEPARATOR.$uri; |
|
| 99 | 99 | if (is_readable($uri)) { |
| 100 | 100 | return $uri; |
| 101 | 101 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * |
| 31 | 31 | * @since 0.1.0 |
| 32 | 32 | * |
| 33 | - * @param array $criteria Criteria to search for. |
|
| 33 | + * @param string[] $criteria Criteria to search for. |
|
| 34 | 34 | * @param EngineInterface $engine Optional. Engine to use with the view. |
| 35 | 35 | * |
| 36 | 36 | * @return ViewInterface View that was found. |
@@ -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.'), |
@@ -226,7 +226,7 @@ |
||
| 226 | 226 | $type = $type($uri, $engine); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - if (! $type instanceof ViewInterface) { |
|
| 229 | + if ( ! $type instanceof ViewInterface) { |
|
| 230 | 230 | throw new FailedToInstantiateViewException( |
| 231 | 231 | sprintf( |
| 232 | 232 | _('Could not instantiate view "%s".'), |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @param string $uri URI to get a view for. |
| 126 | 126 | * @param EngineInterface $engine Engine to use for the view. |
| 127 | - * @param mixed $type Type of view to get. |
|
| 127 | + * @param string|null $type Type of view to get. |
|
| 128 | 128 | * |
| 129 | 129 | * @return ViewInterface View that matches the given requirements. |
| 130 | 130 | */ |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | * |
| 189 | 189 | * @since 0.1.0 |
| 190 | 190 | * |
| 191 | - * @param array $criteria Criteria to match. |
|
| 191 | + * @param string[] $criteria Criteria to match. |
|
| 192 | 192 | * |
| 193 | - * @return string|bool URI of the requested view, or false if not found. |
|
| 193 | + * @return string|false URI of the requested view, or false if not found. |
|
| 194 | 194 | */ |
| 195 | 195 | public function scanLocations(array $criteria) |
| 196 | 196 | { |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | * |
| 72 | 72 | * @since 0.1.0 |
| 73 | 73 | * |
| 74 | - * @param mixed $engine Engine to instantiate. |
|
| 74 | + * @param \BrightNucleus\View\Support\Findable $engine Engine to instantiate. |
|
| 75 | 75 | * |
| 76 | 76 | * @return EngineInterface Instantiated engine. |
| 77 | 77 | * @throws FailedToInstantiateEngineException If the engine could not be instantiated. |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $engine = $this->initializeEngine($engine); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if (! is_object($this->nullObject)) { |
|
| 64 | + if ( ! is_object($this->nullObject)) { |
|
| 65 | 65 | $this->nullObject = new $this->nullObject(); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $engine = $engine(); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if (! $engine instanceof EngineInterface) { |
|
| 89 | + if ( ! $engine instanceof EngineInterface) { |
|
| 90 | 90 | throw new FailedToInstantiateEngineException( |
| 91 | 91 | sprintf( |
| 92 | 92 | _('Could not instantiate engine "%s".'), |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | * |
| 78 | 78 | * @since 0.1.0 |
| 79 | 79 | * |
| 80 | - * @param mixed $view View to instantiate. |
|
| 80 | + * @param \BrightNucleus\View\Support\Findable $view View to instantiate. |
|
| 81 | 81 | * @param string $uri URI to use for the view. |
| 82 | 82 | * @param EngineInterface $engine Optional. Engine to use with the view. |
| 83 | 83 | * |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $view = $this->initializeView($view, $uri, $engine); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (! is_object($this->nullObject)) { |
|
| 70 | + if ( ! is_object($this->nullObject)) { |
|
| 71 | 71 | $this->nullObject = new $this->nullObject(); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $view = $view($uri, $engine); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if (! $view instanceof ViewInterface) { |
|
| 97 | + if ( ! $view instanceof ViewInterface) { |
|
| 98 | 98 | throw new FailedToInstantiateViewException( |
| 99 | 99 | sprintf( |
| 100 | 100 | _('Could not instantiate view "%s".'), |