Code Duplication    Length = 41-44 lines in 2 locations

src/LIN3S/CMSKernel/Application/Command/Menu/ManageMenuCommand.php 1 location

@@ 17-57 (lines=41) @@
14
/**
15
 * @author Beñat Espiña <[email protected]>
16
 */
17
class ManageMenuCommand
18
{
19
    private $menuId;
20
    private $locale;
21
    private $items;
22
    private $name;
23
24
    public function __construct($locale, $name, array $items = [], $menuId = null)
25
    {
26
        if (null === $locale) {
27
            throw new \InvalidArgumentException('The locale cannot be null');
28
        }
29
        if (null === $name) {
30
            throw new \InvalidArgumentException('The name cannot be null');
31
        }
32
        $this->menuId = $menuId;
33
        $this->locale = $locale;
34
        $this->name = $name;
35
        $this->items = $items;
36
    }
37
38
    public function menuId()
39
    {
40
        return $this->menuId;
41
    }
42
43
    public function locale()
44
    {
45
        return $this->locale;
46
    }
47
48
    public function name()
49
    {
50
        return $this->name;
51
    }
52
53
    public function items()
54
    {
55
        return $this->items;
56
    }
57
}
58

src/LIN3S/CMSKernel/Application/Command/Menu/ManageMenuTranslationCommand.php 1 location

@@ 17-60 (lines=44) @@
14
/**
15
 * @author Beñat Espiña <[email protected]>
16
 */
17
class ManageMenuTranslationCommand
18
{
19
    private $menuId;
20
    private $items;
21
    private $locale;
22
    private $name;
23
24
    public function __construct($menuId, $locale, $name, array $items = [])
25
    {
26
        if (null === $menuId) {
27
            throw new \InvalidArgumentException('The menu id cannot be null');
28
        }
29
        if (null === $locale) {
30
            throw new \InvalidArgumentException('The locale cannot be null');
31
        }
32
        if (null === $name) {
33
            throw new \InvalidArgumentException('The name cannot be null');
34
        }
35
        $this->menuId = $menuId;
36
        $this->locale = $locale;
37
        $this->name = $name;
38
        $this->items = $items;
39
    }
40
41
    public function menuId()
42
    {
43
        return $this->menuId;
44
    }
45
46
    public function locale()
47
    {
48
        return $this->locale;
49
    }
50
51
    public function name()
52
    {
53
        return $this->name;
54
    }
55
56
    public function items()
57
    {
58
        return $this->items;
59
    }
60
}
61