@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public static function cast(object $sourceObject, string $destinationClass) |
21 | 21 | { |
22 | - if(!class_exists($destinationClass)) { |
|
22 | + if (!class_exists($destinationClass)) { |
|
23 | 23 | throw new TypeError("Class '{$destinationClass}' does not exist"); |
24 | 24 | } |
25 | 25 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | // Unfortunately PHPstan has a problem with function is_subclass_of(). So: |
29 | 29 | // @phpstan-ignore-next-line |
30 | - if(!is_subclass_of($sourceClass, $destinationClass) && !is_subclass_of($destinationClass, $sourceClass)) { |
|
30 | + if (!is_subclass_of($sourceClass, $destinationClass) && !is_subclass_of($destinationClass, $sourceClass)) { |
|
31 | 31 | throw new TypeError("Classes '{$sourceClass}' and '{$destinationClass}' must be relatives"); |
32 | 32 | } |
33 | 33 |