Completed
Push — master ( c1cd82...4c112d )
by Gorka
03:17
created

CreateOrganizationCommand::ownerId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Kreta package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace Kreta\TaskManager\Application\Organization;
16
17
use Kreta\SharedKernel\Domain\Model\InvalidArgumentException;
18
19
class CreateOrganizationCommand
20
{
21
    private $creatorId;
22
    private $name;
23
    private $id;
24
    private $slug;
25
26
    public function __construct(
27
        string $creatorId,
28
        string $name,
29
        string $id = null,
30
        string $slug = null
31
    ) {
32
        if ('' === $creatorId) {
33
            throw new InvalidArgumentException('User id cannot be null');
34
        }
35
        $this->id = $id;
36
        $this->creatorId = $creatorId;
37
        $this->name = $name;
38
        $this->slug = $slug;
39
    }
40
41
    public function id()
42
    {
43
        return $this->id;
44
    }
45
46
    public function name() : string
47
    {
48
        return $this->name;
49
    }
50
51
    public function creatorId(): string
52
    {
53
        return $this->creatorId;
54
    }
55
56
    public function slug()
57
    {
58
        return $this->slug;
59
    }
60
}
61