| Conditions | 5 |
| Paths | 3 |
| Total Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | |||
| 16 | 112 | protected function RememberDaftObjectData(DefinesOwnIdPropertiesInterface $object) : void |
|
| 17 | { |
||
| 18 | 112 | static::ThrowIfNotType($object, DaftNestedWriteableObject::class, 1, __METHOD__); |
|
| 19 | |||
| 20 | 112 | parent::RememberDaftObjectData($object); |
|
| 21 | 112 | } |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @param DaftObject|string $object |
||
| 25 | */ |
||
| 26 | 114 | protected static function ThrowIfNotType( |
|
| 27 | $object, |
||
| 28 | string $type, |
||
| 29 | int $argument, |
||
| 30 | string $function |
||
| 31 | ) : void { |
||
| 32 | 114 | if ( ! is_a($object, DaftNestedWriteableObject::class, is_string($object))) { |
|
| 33 | 2 | throw new DaftObjectRepositoryTypeByClassMethodAndTypeException( |
|
| 34 | 2 | $argument, |
|
| 35 | 2 | static::class, |
|
| 36 | 2 | $function, |
|
| 37 | 2 | DaftNestedWriteableObject::class, |
|
| 38 | 2 | is_string($object) ? $object : get_class($object) |
|
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | 112 | parent::ThrowIfNotType($object, $type, $argument, $function); |
|
| 43 | 112 | } |
|
| 44 | } |
||
| 45 |