Bootstrap3Table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A open() 0 9 2
1
<?php
2
3
namespace BootPress\Bootstrap;
4
5
use BootPress\Table\Component as Table;
6
7
class Bootstrap3Table extends Table
8
{
9
    use Base;
10
11 1
    public function open($vars = '', $caption = '')
12
    {
13 1
        $vars = $this->values($vars);
14 1
        if (isset($vars['class'])) {
15 1
            $vars['class'] = $this->prefixClasses('table', array('responsive', 'bordered', 'striped', 'hover', 'condensed'), $vars['class']);
16 1
        }
17
18 1
        return parent::open($vars, $caption);
0 ignored issues
show
Documentation introduced by
$vars is of type array<string,string|null,{"class":"string|null"}>, but the function expects a string.

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
}
21