| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class CallbackHandler implements Handler |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var callable |
||
| 15 | */ |
||
| 16 | protected $callable; |
||
| 17 | |||
| 18 | |||
| 19 | 6 | public function __construct( |
|
| 20 | callable $callable, |
||
| 21 | ) { |
||
| 22 | 6 | $this->callable = $callable; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The check method is called to determine if the closure should be called. |
||
| 27 | * In the case of the callback handler it will always return true |
||
| 28 | * |
||
| 29 | * @param InterceptedCommand $intercepted |
||
| 30 | * @return boolean |
||
| 31 | */ |
||
| 32 | 4 | public function check(InterceptedCommand $intercepted): bool |
|
| 35 | } |
||
| 36 | |||
| 37 | 4 | public function handle(InterceptedCommand $intercepted): void |
|
| 41 | } |
||
| 42 | } |
||
| 44 |