Member   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 47
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A id() 0 4 1
A createdOn() 0 4 1
A organization() 0 4 1
A updatedOn() 0 4 1
A userId() 0 4 1
A __toString() 0 4 1
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\Domain\Model\Organization;
16
17
use Kreta\TaskManager\Domain\Model\User\UserId;
18
19
abstract class Member
20
{
21
    protected $id;
22
    protected $createdOn;
23
    protected $updatedOn;
24
    protected $userId;
25
    protected $organization;
26
27
    public function __construct(MemberId $id, UserId $userId, Organization $organization)
28
    {
29
        $this->id = $id;
30
        $this->userId = $userId;
31
        $this->organization = $organization;
32
        $this->createdOn = new \DateTimeImmutable();
33
        $this->updatedOn = new \DateTimeImmutable();
34
    }
35
36
    public function id() : MemberId
37
    {
38
        return $this->id;
39
    }
40
41
    public function createdOn() : \DateTimeInterface
42
    {
43
        return $this->createdOn;
44
    }
45
46
    public function organization() : Organization
47
    {
48
        return $this->organization;
49
    }
50
51
    public function updatedOn() : \DateTimeInterface
52
    {
53
        return $this->updatedOn;
54
    }
55
56
    public function userId() : UserId
57
    {
58
        return $this->userId;
59
    }
60
61
    public function __toString() : string
62
    {
63
        return (string) $this->id->id();
64
    }
65
}
66