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
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Exception;
6
7use Stewart\Contracts\Exception\StewartException;
8
9/** @extends StewartException<ControlError> */
10final 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}