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

State   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 42.86%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 70
ccs 6
cts 14
cp 0.4286
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getActivity() 0 4 1
A getRegistrationId() 0 4 1
A getStateId() 0 4 1
A getAgent() 0 4 1
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