Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| UnexpectedQueryResponseException | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| withExpectedType | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace Phexium\Plugin\QueryBus\Port\Exception; |
| 11 | |
| 12 | use Phexium\Application\Query\QueryResponseInterface; |
| 13 | use RuntimeException; |
| 14 | |
| 15 | final class UnexpectedQueryResponseException extends RuntimeException |
| 16 | { |
| 17 | public static function withExpectedType(string $expectedClass, QueryResponseInterface $actualResponse): self |
| 18 | { |
| 19 | return new self(sprintf( |
| 20 | 'Expected %s from the query bus, got %s.', |
| 21 | $expectedClass, |
| 22 | $actualResponse::class, |
| 23 | )); |
| 24 | } |
| 25 | } |