Completed
Pull Request — master (#3)
by Christian
03:02
created

StatementReference::equals()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 6
1
<?php
2
3
/*
4
 * This file is part of the xAPI package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
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 Xabbuh\XApi\Model;
13
14
/**
15
 * A reference to an existing {@link Statement}.
16
 *
17
 * @author Christian Flothmann <[email protected]>
18
 */
19
final class StatementReference extends Object
20
{
21
    /**
22
     * @var string The id of the referenced Statement
23
     */
24
    private $statementId;
25
26
    /**
27
     * @param string $statementId
28
     */
29
    public function __construct($statementId)
30
    {
31
        $this->statementId = $statementId;
32
    }
33
34
    /**
35
     * Returns the id of the referenced Statement.
36
     *
37
     * @return string The id
38
     */
39
    public function getStatementId()
40
    {
41
        return $this->statementId;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function equals(Object $object)
48
    {
49
        if ('Xabbuh\XApi\Model\StatementReference' !== get_class($object)) {
50
            return false;
51
        }
52
53
        /** @var StatementReference $object */
54
55
        return $this->statementId === $object->statementId;
56
    }
57
}
58