Code Duplication    Length = 44-44 lines in 2 locations

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

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

@@ 17-60 (lines=44) @@
14
/**
15
 * @author Beñat Espiña <[email protected]>
16
 */
17
class AddMenuCommand
18
{
19
    private $menuId;
20
    private $code;
21
    private $locale;
22
    private $name;
23
24
    public function __construct($locale, $code, $name, $menuId = null)
25
    {
26
        if (null === $locale) {
27
            throw new \InvalidArgumentException('The locale cannot be null');
28
        }
29
        if (null === $code) {
30
            throw new \InvalidArgumentException('The code cannot be null');
31
        }
32
        if (null === $name) {
33
            throw new \InvalidArgumentException('The name cannot be null');
34
        }
35
        $this->menuId = $menuId;
36
        $this->code = $code;
37
        $this->locale = $locale;
38
        $this->name = $name;
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 code()
52
    {
53
        return $this->code;
54
    }
55
56
    public function name()
57
    {
58
        return $this->name;
59
    }
60
}
61