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

StatementReference   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 4
c 4
b 0
f 0
lcom 1
cbo 1
dl 0
loc 39
ccs 0
cts 15
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getStatementId() 0 4 1
A equals() 0 10 2
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