Completed
Pull Request — master (#22)
by Daryl
02:30
created

Map_View   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

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