Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

SimpleBulkAction::getTemplate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Kunstmaan\AdminListBundle\AdminList\BulkAction;
4
5
/**
6
 * The simple bulk action is a default implementation of the bulk action interface, this can be used
7
 * in very simple use cases.
8
 */
9
class SimpleBulkAction implements BulkActionInterface
10
{
11
    /**
12
     * @var array
13
     */
14
    private $url;
15
16
    /**
17
     * @var string
18
     */
19
    private $icon;
20
21
    /**
22
     * @var string
23
     */
24
    private $label;
25
26
    /**
27
     * @var string|null
28
     */
29
    private $template;
30
31
    /**
32
     * @param array  $url      The url path and parameters
33
     * @param string $label    The label
34
     * @param string $icon     The icon
0 ignored issues
show
Documentation introduced by Kristof Jochmans
Should the type for parameter $icon not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
35
     * @param string $template The template
0 ignored issues
show
Documentation introduced by Kristof Jochmans
Should the type for parameter $template not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
36
     */
37 1 View Code Duplication
    public function __construct(array $url, $label, $icon = null, $template = null)
0 ignored issues
show
Duplication introduced by Kristof Jochmans
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38
    {
39 1
        $this->url = $url;
40 1
        $this->icon = $icon;
41 1
        $this->label = $label;
42 1
        $this->template = $template;
43 1
    }
44
45
    /**
46
     * @return array
47
     */
48 1
    public function getUrl()
49
    {
50 1
        return $this->url;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 1
    public function getIcon()
57
    {
58 1
        return $this->icon;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 1
    public function getLabel()
65
    {
66 1
        return $this->label;
67
    }
68
69
    /**
70
     * @return string
0 ignored issues
show
Documentation introduced by Kristof Jochmans
Should the return type not be string|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
71
     */
72 1
    public function getTemplate()
73
    {
74 1
        return $this->template;
75
    }
76
}
77