Completed
Pull Request — master (#52)
by
unknown
02:23
created

State::getAgent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
 * An activity provider's state stored on a remote LRS.
16
 *
17
 * @author Christian Flothmann <[email protected]>
18
 */
19
final class State
20
{
21
    /**
22
     * @var Activity The associated activity
23
     */
24
    private $activity;
25
26
    /**
27
     * @var Agent The associated agent
28
     */
29
    private $agent;
30
31
    /**
32
     * @var string An optional registration id
33
     */
34
    private $registrationId;
35
36
    /**
37
     * @var string The state id
38
     */
39
    private $stateId;
40
41 4
    public function __construct(Activity $activity, Agent $agent, $stateId, $registrationId = null)
42
    {
43 4
        $this->activity = $activity;
44 4
        $this->agent = $agent;
45 4
        $this->stateId = $stateId;
46 4
        $this->registrationId = $registrationId;
47 4
    }
48
49
    /**
50
     * Returns the activity.
51
     *
52
     * @return Activity The activity
53
     */
54
    public function getActivity()
55
    {
56
        return $this->activity;
57
    }
58
59
    /**
60
     * Returns the agent.
61
     *
62
     * @return Agent The agent
63
     */
64
    public function getAgent()
65
    {
66
        return $this->agent;
67
    }
68
69
    /**
70
     * Returns the registration id.
71
     *
72
     * @return string The registration id
73
     */
74
    public function getRegistrationId()
75
    {
76
        return $this->registrationId;
77
    }
78
79
    /**
80
     * Returns the state's id.
81
     *
82
     * @return string The id
83
     */
84
    public function getStateId()
85
    {
86
        return $this->stateId;
87
    }
88
}
89