View::render()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Vertex\Core;
4
5
use Jenssegers\Blade\Blade;
6
7
class View
8
{
9
    /**
10
     * Renders a view.
11
     * 
12
     * @param  string $view       
13
     * @param  array  $parameters 
14
     * @return \Jenssegers\Blade\Blade
15
     */
16
    public static function render(string $view, array $parameters = [])
17
    {
18
        $blade = new Blade(__DIR__.'/../resources/views/', Config::get('view')['cache']);
0 ignored issues
show
Documentation introduced by
__DIR__ . '/../resources/views/' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
19
20
        return $blade->make($view, $parameters);
21
    }
22
}
23