Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| PropertyDoesNotExistException | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
30 | |||
| 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 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\taoQtiItem\model\qti\metadata\importer; |
| 24 | |
| 25 | use Exception; |
| 26 | |
| 27 | class PropertyDoesNotExistException extends Exception |
| 28 | { |
| 29 | public function __construct(array $message) |
| 30 | { |
| 31 | if (isset($message['checksum_result']) && $message['checksum_result'] === false) { |
| 32 | parent::__construct( |
| 33 | sprintf( |
| 34 | 'The property %s selected list is not defined as expected by the imported package', |
| 35 | $message['label'] ?? 'unknown label', |
| 36 | ) |
| 37 | ); |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | if (isset($message['widget_result']) && $message['widget_result'] === false) { |
| 42 | parent::__construct( |
| 43 | sprintf( |
| 44 | 'The property %s selected widget is not defined as expected by the imported package', |
| 45 | $message['label'] ?? 'unknown label', |
| 46 | ) |
| 47 | ); |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | parent::__construct( |
| 52 | sprintf( |
| 53 | 'Property with label %s and alias %s does not exist.', |
| 54 | $message['label'] ?? 'unknown label', |
| 55 | $message['alias'] ?? 'unknown alias' |
| 56 | ) |
| 57 | ); |
| 58 | } |
| 59 | } |