View   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 6 1
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