Completed
Push — master ( ab60cd...6758af )
by Ivannis Suárez
05:44
created

User::email()   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 Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Core\Storage\Tests\Fixtures;
13
14
use Cubiche\Core\Equatable\Equatable;
15
use Cubiche\Core\Serializer\SerializableInterface;
16
17
/**
18
 * User Class.
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 */
22
class User extends Equatable implements SerializableInterface
23
{
24
    /**
25
     * @var string
26
     */
27
    protected $name;
28
29
    /**
30
     * @var int
31
     */
32
    protected $age;
33
34
    /**
35
     * @var string
36
     */
37
    protected $email;
38
39
    /**
40
     * @param string $name
41
     * @param int    $age
42
     * @param string $email
43
     */
44
    public function __construct($name, $age, $email)
45
    {
46
        $this->name = $name;
47
        $this->age = $age;
48
        $this->email = $email;
49
    }
50
51
    /**
52
     * @return int
53
     */
54
    public function age()
55
    {
56
        return $this->age;
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function name()
63
    {
64
        return $this->name;
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function email()
71
    {
72
        return $this->email;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function equals($other)
79
    {
80
        return $this->name() == $other->name() &&
81
            $this->age() == $other->age() &&
82
            $this->email() == $other->email()
83
        ;
84
    }
85
}
86