Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ClassPropertiesChangedEvent | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
3.33 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProperties | |
100.00% |
1 / 1 |
|
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) 2020 (original work) Open Assessment Technologies SA; |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\tao\model\event; |
| 24 | |
| 25 | use oat\oatbox\event\Event; |
| 26 | |
| 27 | class ClassPropertiesChangedEvent implements Event |
| 28 | { |
| 29 | /** |
| 30 | * @var array[{property: \core_kernel_classes_Property, oldProperty: \oat\tao\model\dto\OldProperty}] |
| 31 | * |
| 32 | * list of properties that were changed, with the following structure: |
| 33 | * $properties = [ |
| 34 | * [ |
| 35 | * 'class' => (\core_kernel_classes_Class), current class where changes were made |
| 36 | * 'property' => (\core_kernel_classes_Property), this is the current property |
| 37 | * 'oldProperty' => (\oat\tao\model\dto\OldProperty) this is a DTO object representing the old values |
| 38 | * ], |
| 39 | * ... |
| 40 | * ]; |
| 41 | * |
| 42 | */ |
| 43 | private $properties; |
| 44 | |
| 45 | public function __construct(array $properties) |
| 46 | { |
| 47 | $this->properties = $properties; |
| 48 | } |
| 49 | |
| 50 | public function getName(): string |
| 51 | { |
| 52 | return self::class; |
| 53 | } |
| 54 | |
| 55 | public function getProperties(): array |
| 56 | { |
| 57 | return $this->properties; |
| 58 | } |
| 59 | } |