Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
8 / 8 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Metadata | |
100.00% |
8 / 8 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getMetadataId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMetadataContent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
jsonSerialize | |
100.00% |
4 / 4 |
|
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) 2022 (original work) Open Assessment Technologies SA; |
19 | */ |
20 | |
21 | declare(strict_types=1); |
22 | |
23 | namespace oat\taoDelivery\model\execution\metadata; |
24 | |
25 | use JsonSerializable; |
26 | |
27 | class Metadata implements JsonSerializable |
28 | { |
29 | public const METADATA_ID = 'metadataId'; |
30 | public const METADATA_CONTENT = 'metadataContent'; |
31 | |
32 | private string $metadataId; |
33 | |
34 | private $metadataContent; |
35 | |
36 | public function __construct(string $metadataId, $metadataContent) |
37 | { |
38 | $this->metadataId = $metadataId; |
39 | $this->metadataContent = $metadataContent; |
40 | } |
41 | |
42 | public function getMetadataId(): string |
43 | { |
44 | return $this->metadataId; |
45 | } |
46 | |
47 | public function getMetadataContent() |
48 | { |
49 | return $this->metadataContent; |
50 | } |
51 | |
52 | public function jsonSerialize(): array |
53 | { |
54 | return [ |
55 | self::METADATA_ID => $this->metadataId, |
56 | self::METADATA_CONTENT => $this->metadataContent |
57 | ]; |
58 | } |
59 | } |