Code Duplication    Length = 31-38 lines in 2 locations

src/Event/Commands/Conclude.php 1 location

@@ 5-35 (lines=31) @@
2
3
namespace CultuurNet\UDB3\Event\Commands;
4
5
class Conclude
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $itemId;
11
12
    /**
13
     * Conclude constructor.
14
     *
15
     * @param string $itemId
16
     */
17
    public function __construct($itemId)
18
    {
19
        if (!is_string($itemId)) {
20
            throw new \InvalidArgumentException(
21
                'Expected itemId to be a string, received ' . gettype($itemId)
22
            );
23
        }
24
25
        $this->itemId = $itemId;
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getItemId()
32
    {
33
        return $this->itemId;
34
    }
35
}
36

src/Offer/Commands/AbstractCommand.php 1 location

@@ 7-44 (lines=38) @@
4
5
use CultuurNet\UDB3\Role\ValueObjects\Permission;
6
7
abstract class AbstractCommand implements AuthorizableCommandInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $itemId;
13
14
    /**
15
     * AbstractCommand constructor.
16
     * @param string $itemId
17
     */
18
    public function __construct($itemId)
19
    {
20
        if (!is_string($itemId)) {
21
            throw new \InvalidArgumentException(
22
                'Expected itemId to be a string, received ' . gettype($itemId)
23
            );
24
        }
25
26
        $this->itemId = $itemId;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getItemId()
33
    {
34
        return $this->itemId;
35
    }
36
37
    /**
38
     * @return Permission
39
     */
40
    public function getPermission()
41
    {
42
        return Permission::AANBOD_BEWERKEN();
43
    }
44
}
45