Completed
Push — 8.x-1.x ( 695218...eb0c37 )
by
unknown
23:34 queued 17:45
created

Route::setAdmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Drupal\controller_annotations\Configuration;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route as BaseRoute;
6
7
/**
8
 * @Annotation
9
 */
10
class Route extends BaseRoute
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $admin;
16
17
    /**
18
     * @return bool
19
     */
20 5
    public function isAdmin()
21
    {
22 5
        return $this->admin;
23
    }
24
25
    /**
26
     * @param bool $admin
27
     * @return Route
28
     */
29 5
    public function setAdmin($admin)
30
    {
31 5
        $this->admin = $admin;
0 ignored issues
show
Documentation Bug introduced by
The property $admin was declared of type string, but $admin is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
32
33 5
        return $this;
34
    }
35
}
36