Lines
0.00%
0 / 10
Functions and Methods
0.00%
0 / 2
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AppException | 0.00% | 0 / 10 | 0.00% | 0 / 2 | 20 | 0.00% | 0 / 1 | |||
| unknown | 0.00% | 0 / 5 | 0.00% | 0 / 1 | 6 | |||||
| instanceClassMissing | 0.00% | 0 / 5 | 0.00% | 0 / 1 | 6 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Exception; | |
| 6 | ||
| 7 | use Stewart\Contracts\App\AppId; | |
| 8 | use Stewart\Contracts\Exception\StewartException; | |
| 9 | ||
| 10 | /** @extends StewartException<AppError> */ | |
| 11 | final class AppException extends StewartException | |
| 12 | { | |
| 13 | public static function unknown(AppId $appId, ?string $suggestion = null): self | |
| 14 | { | |
| 15 | return self::createForReasonWithAppendedText( | |
| 16 | AppError::Unknown, | |
| 17 | ['appId' => $appId->value, 'suggestion' => $suggestion], | |
| 18 | $suggestion === null ? null : \sprintf('Did you mean "%s"?', $suggestion), | |
| 19 | ); | |
| 20 | } | |
| 21 | ||
| 22 | public static function instanceClassMissing(AppId $appId, string $className, ?string $suggestion): self | |
| 23 | { | |
| 24 | return self::createForReasonWithAppendedText( | |
| 25 | AppError::InstanceClassMissing, | |
| 26 | ['appId' => $appId->value, 'className' => $className, 'suggestion' => $suggestion], | |
| 27 | $suggestion === null ? null : \sprintf('Did you mean %s?', $suggestion), | |
| 28 | ); | |
| 29 | } | |
| 30 | } |