Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
1 / 1
ItemResponse
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
7 / 7
7
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
 getItemIdentifier
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getState
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getResponse
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDuration
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTimestamp
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 removeDuration
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2021 (original work) Open Assessment Technologies SA;
19 *
20 * @author Ricardo Quintanilha <ricardo.quintanilha@taotesting.com>
21 */
22
23declare(strict_types=1);
24
25namespace oat\taoQtiTest\model\Domain\Model;
26
27final class ItemResponse
28{
29    /** @var string */
30    private $itemIdentifier;
31
32    /** @var array|null */
33    private $state;
34
35    /** @var array|null */
36    private $response;
37
38    /** @var float|null */
39    private $duration;
40
41    /** @var float|null */
42    private $timestamp;
43
44    public function __construct(
45        string $itemIdentifier,
46        ?array $state,
47        ?array $response,
48        ?float $duration,
49        ?float $timestamp = null
50    ) {
51        $this->itemIdentifier = $itemIdentifier;
52        $this->state = $state;
53        $this->response = $response;
54        $this->duration = $duration;
55        $this->timestamp = $timestamp;
56    }
57
58    public function getItemIdentifier(): string
59    {
60        return $this->itemIdentifier;
61    }
62
63    public function getState(): ?array
64    {
65        return $this->state;
66    }
67
68    public function getResponse(): ?array
69    {
70        return $this->response;
71    }
72
73    public function getDuration(): ?float
74    {
75        return $this->duration;
76    }
77
78    public function getTimestamp(): ?float
79    {
80        return $this->timestamp;
81    }
82
83    public function removeDuration(): void
84    {
85        $this->duration = null;
86    }
87}