UserId::id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Author: Nil Portugués Calderó <[email protected]>
5
 * Date: 7/02/16
6
 * Time: 18:12.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace NilPortugues\Example\Domain;
12
13
use NilPortugues\Foundation\Domain\Model\Repository\Contracts\Identity;
14
15
/**
16
 * Class UserId.
17
 */
18
class UserId implements Identity
19
{
20
    private $id;
21
22
    /**
23
     * UserId constructor.
24
     *
25
     * @param $id
26
     */
27
    public function __construct($id)
28
    {
29
        $this->id = $id;
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35
    public function id()
36
    {
37
        return $this->id;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function __toString()
44
    {
45
        return (string) $this->id();
46
    }
47
}
48