Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
ResourceTranslatableStatus
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
8 / 8
8
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
 getUri
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLanguageUri
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isReadyForTranslation
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isEmpty
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setEmpty
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 jsonSerialize
100.00% covered (success)
100.00%
7 / 7
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) 2024 (original work) Open Assessment Technologies SA;
19 */
20
21declare(strict_types=1);
22
23namespace oat\tao\model\Translation\Entity;
24
25use JsonSerializable;
26
27class ResourceTranslatableStatus implements JsonSerializable
28{
29    private string $uri;
30    private string $type;
31    private bool $isReadyForTranslation;
32    private bool $isEmpty;
33    private string $languageUri;
34
35    public function __construct(
36        string $uri,
37        string $type,
38        string $languageUri,
39        bool $isReadyForTranslation,
40        bool $isEmpty
41    ) {
42        $this->isReadyForTranslation = $isReadyForTranslation;
43        $this->isEmpty = $isEmpty;
44        $this->uri = $uri;
45        $this->type = $type;
46        $this->languageUri = $languageUri;
47    }
48
49    public function getUri(): string
50    {
51        return $this->uri;
52    }
53
54    public function getType(): string
55    {
56        return $this->type;
57    }
58
59    public function getLanguageUri(): string
60    {
61        return $this->languageUri;
62    }
63
64    public function isReadyForTranslation(): bool
65    {
66        return $this->isReadyForTranslation;
67    }
68
69    public function isEmpty(): bool
70    {
71        return $this->isEmpty;
72    }
73
74    public function setEmpty(bool $isEmpty): void
75    {
76        $this->isEmpty = $isEmpty;
77    }
78
79    public function jsonSerialize(): array
80    {
81        return [
82            'uri' => $this->getUri(),
83            'type' => $this->getType(),
84            'languageUri' => $this->getLanguageUri(),
85            'isReadyForTranslation' => $this->isReadyForTranslation(),
86            'isEmpty' => $this->isEmpty(),
87        ];
88    }
89}