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

RouterFactory::createRouter()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 21
nc 1
nop 0
dl 0
loc 24
rs 8.9713
c 1
b 0
f 0
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