StatementResultFixtures   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 38
rs 10
c 4
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getStatementResult() 0 16 1
A getStatementResultWithMore() 0 6 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\DataFixtures;
13
14
use Xabbuh\XApi\Model\Agent;
15
use Xabbuh\XApi\Model\Statement;
16
use Xabbuh\XApi\Model\StatementResult;
17
use Xabbuh\XApi\Model\Verb;
18
19
/**
20
 * Statement result fixtures.
21
 *
22
 * @author Christian Flothmann <[email protected]>
23
 */
24
class StatementResultFixtures
25
{
26
    /**
27
     * Loads a statement result.
28
     *
29
     * @param string $urlPath An optional URL path refering to more results
30
     *
31
     * @return StatementResult
32
     */
33
    public static function getStatementResult($urlPath = null)
34
    {
35
        $statement1 = StatementFixtures::getMinimalStatement();
36
37
        $verb = new Verb('http://adlnet.gov/expapi/verbs/deleted', array('en-US' => 'deleted'));
38
        $statement2 = new Statement(
39
            '12345678-1234-5678-8234-567812345679',
40
            new Agent('mailto:[email protected]'),
41
            $verb,
42
            $statement1->getObject()
43
        );
44
45
        $statementResult = new StatementResult(array($statement1, $statement2), $urlPath);
46
47
        return $statementResult;
48
    }
49
50
    /**
51
     * Loads a statement result including a more reference.
52
     *
53
     * @return StatementResult
54
     */
55
    public static function getStatementResultWithMore()
56
    {
57
        $statementResult = static::getStatementResult('/xapi/statements/more/b381d8eca64a61a42c7b9b4ecc2fabb6');
58
59
        return $statementResult;
60
    }
61
}
62