RouterFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
3
namespace Symnedi\EventDispatcher\Tests\NetteEvent\DispatchSource;
4
5
use Nette\Application\Routers\Route;
6
use Nette\Application\Routers\RouteList;
7
8
9
class RouterFactory
10
{
11
12
	/**
13
	 * @return RouteList
14
	 */
15
	public function create()
16
	{
17
		$routes = new RouteList;
18
		$routes[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
0 ignored issues
show
Documentation introduced by
'Homepage:default' 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
		$routes[] = new Route('<presenter>/<action>', 'Homepage:default');
0 ignored issues
show
Documentation introduced by
'Homepage:default' 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...
20
		$routes[] = new Route('<presenter>/<action>', 'Response:default');
0 ignored issues
show
Documentation introduced by
'Response:default' 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...
21
		return $routes;
22
	}
23
24
}
25