Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| FlowBaseException | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Flow\Exception; |
| 5 | |
| 6 | use Throwable; |
| 7 | use Wikimedia\NormalizedException\NormalizedException; |
| 8 | |
| 9 | /** |
| 10 | * Workaround for a PHP 7.4 issue (T384905). |
| 11 | * |
| 12 | * This class exists because, if {@link FlowException} directly extends {@link NormalizedException}, |
| 13 | * PHP will complain that {@link FlowException::__construct()} has a signature |
| 14 | * that is not compatible with {@link FlowException::normalizedConstructor()}. |
| 15 | * The error only exists in PHP 7.4 and earlier (PHP 8 correctly recognizes that |
| 16 | * incompatible constructor signatures are not problematic, because constructors |
| 17 | * are not called as methods on an existing object instance of an unknown subclass), |
| 18 | * so this class can be removed once we only support PHP 8. |
| 19 | * |
| 20 | * @license GPL-2.0-or-later |
| 21 | */ |
| 22 | class FlowBaseException extends NormalizedException { |
| 23 | |
| 24 | public function __construct( |
| 25 | string $normalizedMessage, |
| 26 | array $messageContext = [], |
| 27 | int $code = 0, |
| 28 | ?Throwable $previous = null |
| 29 | ) { |
| 30 | parent::__construct( $normalizedMessage, $messageContext, $code, $previous ); |
| 31 | } |
| 32 | |
| 33 | } |