Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
75.00% |
9 / 12 |
|
57.14% |
4 / 7 |
CRAP | |
0.00% |
0 / 1 |
| OldProperty | |
75.00% |
9 / 12 |
|
57.14% |
4 / 7 |
7.77 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| getLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAlias | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPropertyType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getRangeUri | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getValidationRules | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDependsOnPropertyCollection | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 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) 2020-2021 (original work) Open Assessment Technologies SA; |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\tao\model\dto; |
| 24 | |
| 25 | use core_kernel_classes_Resource; |
| 26 | use oat\generis\model\resource\DependsOnPropertyCollection; |
| 27 | |
| 28 | class OldProperty |
| 29 | { |
| 30 | /** @var string */ |
| 31 | private $label; |
| 32 | |
| 33 | /** @var core_kernel_classes_Resource|null */ |
| 34 | private $propertyType; |
| 35 | |
| 36 | /** @var string|null */ |
| 37 | private $rangeUri; |
| 38 | |
| 39 | /** @var array */ |
| 40 | private $validationRules; |
| 41 | |
| 42 | /** @var DependsOnPropertyCollection|null */ |
| 43 | private $dependsOnPropertyCollection; |
| 44 | |
| 45 | /** @var string|null */ |
| 46 | private $alias; |
| 47 | |
| 48 | public function __construct( |
| 49 | string $label, |
| 50 | ?core_kernel_classes_Resource $propertyType, |
| 51 | string $rangeUri = null, |
| 52 | array $validationRules = [], |
| 53 | DependsOnPropertyCollection $dependsOnPropertyCollection = null, |
| 54 | string $alias = null |
| 55 | ) { |
| 56 | $this->label = $label; |
| 57 | $this->propertyType = $propertyType; |
| 58 | $this->rangeUri = $rangeUri; |
| 59 | $this->validationRules = $validationRules; |
| 60 | $this->dependsOnPropertyCollection = $dependsOnPropertyCollection; |
| 61 | $this->alias = $alias; |
| 62 | } |
| 63 | |
| 64 | public function getLabel(): string |
| 65 | { |
| 66 | return $this->label; |
| 67 | } |
| 68 | |
| 69 | public function getAlias(): ?string |
| 70 | { |
| 71 | return $this->alias; |
| 72 | } |
| 73 | |
| 74 | public function getPropertyType(): ?core_kernel_classes_Resource |
| 75 | { |
| 76 | return $this->propertyType; |
| 77 | } |
| 78 | |
| 79 | public function getRangeUri(): ?string |
| 80 | { |
| 81 | return $this->rangeUri; |
| 82 | } |
| 83 | |
| 84 | public function getValidationRules(): array |
| 85 | { |
| 86 | return $this->validationRules; |
| 87 | } |
| 88 | |
| 89 | public function getDependsOnPropertyCollection(): ?DependsOnPropertyCollection |
| 90 | { |
| 91 | return $this->dependsOnPropertyCollection; |
| 92 | } |
| 93 | } |