Test Failed
Pull Request — master (#125)
by Litera
08:49
created

RouterFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B createRouter() 0 24 1
1
<?php
2
3
namespace App\Routers;
4
5
use Nette,
6
	Nette\Application\Routers\RouteList,
7
	Nette\Application\Routers\Route,
8
	Nette\Application\Routers\SimpleRouter;
9
10
11
/**
12
 * Router factory.
13
 */
14
class RouterFactory
15
{
16
17
	/**
18
	 * @return \Nette\Application\IRouter
19
	 */
20
	public function createRouter()
21
	{
22
		$router = new RouteList();
23
		$router[] = new Route('', 'Dashboard:default', Route::ONE_WAY);
0 ignored issues
show
Documentation introduced by
'Dashboard: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...
24
		$router[] = new Route('index.php', 'Dashboard:default', Route::ONE_WAY);
0 ignored issues
show
Documentation introduced by
'Dashboard: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...
25
		$router[] = new Route('dashboard/', 'Dashboard:default');
0 ignored issues
show
Documentation introduced by
'Dashboard: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...
26
		$router[] = new Route('registrace/[<action>/[<guid>/]]', 'Registration:default', Route::ONE_WAY);
0 ignored issues
show
Documentation introduced by
'Registration: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...
27
		$router[] = new Route('registration/[<action>/[<guid>/]]', 'Registration:default');
0 ignored issues
show
Documentation introduced by
'Registration: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...
28
		$router[] = new Route('export/[<action>/[<type>/[<id>/]]]', 'Export:default');
0 ignored issues
show
Documentation introduced by
'Export: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...
29
		$router[] = new Route('block/annotation/<guid>', [
30
			'presenter' => 'Annotation',
31
			'action'    => 'edit',
32
			'type'      => 'block',
33
		], Route::ONE_WAY);
34
		$router[] = new Route('program/annotation/<guid>', [
35
			'presenter' => 'Annotation',
36
			'action'    => 'edit',
37
			'type'      => 'program',
38
		], Route::ONE_WAY);
39
		$router[] = new Route('annotation/<action>/<type>/<guid>/', 'Annotation:default');
0 ignored issues
show
Documentation introduced by
'Annotation: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...
40
		$router[] = new Route('<presenter>/[<action>/[<id>/]]', 'Dashboard:listing');
0 ignored issues
show
Documentation introduced by
'Dashboard:listing' 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...
41
42
		return $router;
43
	}
44
45
}
46