| 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 | use HandlerClassNameTrait; |
||
| 16 | use RuleNameTrait; |
||
| 17 | |||
| 18 | 4 | public function __construct( |
|
| 19 | /** |
||
| 20 | * @var callable |
||
| 21 | */ |
||
| 22 | private $callback, |
||
| 23 | private bool $skipOnEmpty = false, |
||
| 24 | private bool $skipOnError = false, |
||
| 25 | private ?Closure $when = null, |
||
| 26 | ) { |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return callable |
||
| 31 | */ |
||
| 32 | 7 | public function getCallback(): callable |
|
| 33 | { |
||
| 34 | 7 | return $this->callback; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | public function isSkipOnEmpty(): bool |
||
| 41 | { |
||
| 42 | return $this->skipOnEmpty; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return bool |
||
| 47 | */ |
||
| 70 |