| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 92.31% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class Callback implements ParametrizedRuleInterface |
||
| 14 | { |
||
| 15 | 11 | use HandlerClassNameTrait; |
|
| 16 | use RuleNameTrait; |
||
| 17 | |||
| 18 | public function __construct( |
||
| 19 | /** |
||
| 20 | * @var callable |
||
| 21 | */ |
||
| 22 | private $callback, |
||
| 23 | private bool $skipOnEmpty = false, |
||
| 24 | private bool $skipOnError = false, |
||
| 25 | 11 | private ?Closure $when = null, |
|
| 26 | ) { |
||
| 27 | } |
||
| 28 | 10 | ||
| 29 | /** |
||
| 30 | 10 | * @return callable |
|
| 31 | 10 | */ |
|
| 32 | public function getCallback(): callable |
||
| 33 | 10 | { |
|
| 34 | 1 | return $this->callback; |
|
| 35 | } |
||
| 36 | |||
| 37 | 9 | /** |
|
| 38 | 9 | * @return bool |
|
| 39 | */ |
||
| 40 | public function isSkipOnEmpty(): bool |
||
| 41 | { |
||
| 42 | 9 | return $this->skipOnEmpty; |
|
| 43 | 9 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | 9 | * @return bool |
|
| 47 | */ |
||
| 70 |