This class 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...
20
{
21
/** @var ItemBuilder */
22
protected $itemBuilder;
23
24
/** @var AdminGroups */
25
protected $adminGroups;
26
27
/**
28
* ItemParentFactory constructor.
29
*
30
* @param ItemBuilder $itemBuilder
31
*/
32
public function __construct(AdminGroups $adminGroups, ItemBuilder $itemBuilder)
33
{
34
$this->itemBuilder = $itemBuilder;
35
$this->adminGroups = $adminGroups;
36
}
37
38
/**
39
* Check if item factory supports building a certain class.
40
*
41
* @param string $class
42
*
43
* @return boolean
44
*/
45
public function supports($class)
46
{
47
return $class == ParentItem::class;
48
}
49
50
/**
51
* Creates a new Menu item
52
*
53
* @param string $class Class of the item.
54
* @param string $id Id of the item
55
* @param string $path Path of the item
56
* @param string $label
57
* @param string $permission
58
* @param array $options
59
*
60
* @return ItemInterface
61
*/
62
public function build($class, $id, $path, $label, $permission, $options = [])
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.