Lines
100.00%
5 / 5
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| HarnessException | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 2 | 100.00% | 1 / 1 | |||
| optionUnknown | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Testing\Exception; | |
| 6 | ||
| 7 | use Stewart\Contracts\Exception\StewartException; | |
| 8 | ||
| 9 | /** @extends StewartException<HarnessError> */ | |
| 10 | final class HarnessException extends StewartException | |
| 11 | { | |
| 12 | public static function optionUnknown(string $option, string $class, ?string $suggestion): self | |
| 13 | { | |
| 14 | return self::createForReasonWithAppendedText( | |
| 15 | HarnessError::OptionUnknown, | |
| 16 | ['option' => $option, 'class' => $class, 'suggestion' => $suggestion], | |
| 17 | $suggestion === null ? null : \sprintf('Did you mean "%s"?', $suggestion), | |
| 18 | ); | |
| 19 | } | |
| 20 | } |