These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\AdminListBundle\AdminList\ListAction; |
||
4 | |||
5 | /** |
||
6 | * The simple list action is a default implementation of the list action interface, this can be used |
||
7 | * in very simple use cases. |
||
8 | */ |
||
9 | class SimpleListAction implements ListActionInterface |
||
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 null|string |
||
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 |
||
35 | * @param string $template The template |
||
36 | */ |
||
37 | View Code Duplication | public function __construct(array $url, $label, $icon = null, $template = null) |
|
0 ignored issues
–
show
|
|||
38 | { |
||
39 | $this->url = $url; |
||
40 | $this->icon = $icon; |
||
41 | $this->label = $label; |
||
42 | $this->template = $template; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return array |
||
47 | */ |
||
48 | public function getUrl() |
||
49 | { |
||
50 | return $this->url; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getIcon() |
||
57 | { |
||
58 | return $this->icon; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getLabel() |
||
65 | { |
||
66 | return $this->label; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getTemplate() |
||
73 | { |
||
74 | return $this->template; |
||
75 | } |
||
76 | } |
||
77 |
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.