Completed
Pull Request — master (#22)
by Daryl
01:32
created

Map_View::_make_info_windows()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
ccs 0
cts 10
cp 0
rs 9.4285
cc 2
eloc 10
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps;
4
5
/**
6
 * Class Map_View
7
 * @package  Clubdeuce\GoogleMaps
8
 * @property Map $item
9
 * @method   Map_Model $model()
10
 */
11
class Map_View extends \WPLib_View_Base {
12
13
    function the_map() {
14
15
        $view = new \Clubdeuce\WPGoogleMaps\Map_View( $this->model() );
0 ignored issues
show
Documentation introduced by
$this->model() is of type object<WPLib_Model_Base>, but the function expects a object<Clubdeuce\WPGoogleMaps\Map>.

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...
16
17
	    $view->the_map();
18
19
    }
20
21
}
22