Lines
100.00%
2 / 2
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ControlException | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 3 | 100.00% | 1 / 1 | |||
| findBrokerReason | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 3 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Exception; | |
| 6 | ||
| 7 | use Stewart\Contracts\Exception\StewartException; | |
| 8 | ||
| 9 | /** @extends StewartException<ControlError> */ | |
| 10 | final class ControlException extends StewartException | |
| 11 | { | |
| 12 | public function findBrokerReason(): ?string | |
| 13 | { | |
| 14 | $brokerReason = $this->context['reason'] ?? null; | |
| 15 | ||
| 16 | return $this->reason === ControlError::RequestFailed && \is_string($brokerReason) ? $brokerReason : null; | |
| 17 | } | |
| 18 | } |