Completed
Push — master ( ced9b5...a42ee4 )
by Luc
15s
created

AbstractCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUuid() 0 4 1
A getItemId() 0 4 1
A getPermission() 0 4 1
1
<?php
2
3
namespace CultuurNet\UDB3\Role\Commands;
4
5
use CultuurNet\UDB3\Offer\Commands\AuthorizableCommandInterface;
6
use CultuurNet\UDB3\Role\ValueObjects\Permission;
7
use ValueObjects\Identity\UUID;
8
9
abstract class AbstractCommand implements AuthorizableCommandInterface
10
{
11
    /**
12
     * @var UUID
13
     */
14
    private $uuid;
15
16
    /**
17
     * AbstractCommand constructor.
18
     * @param UUID $uuid
19
     */
20
    public function __construct(UUID $uuid)
21
    {
22
        $this->uuid = $uuid;
23
    }
24
25
    /**
26
     * @return UUID
27
     */
28
    public function getUuid()
29
    {
30
        return $this->uuid;
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function getItemId()
37
    {
38
        return (string) $this->getUuid();
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44
    public function getPermission()
45
    {
46
        return Permission::GEBRUIKERS_BEHEREN();
47
    }
48
}
49