| Total Complexity | 7 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 9 | class VisibilityChangeHandler implements \JsonSerializable |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param AbstractStandardCommand[] $commands list of commands to run (evaluated in order) |
||
| 13 | * @param string|null $when APL boolean expression controlling whether this handler is considered. If null, treated as 'true'. |
||
| 14 | * @param string|null $description optional description of this handler |
||
| 15 | */ |
||
| 16 | 19 | public function __construct( |
|
| 17 | public array $commands = [], |
||
| 18 | public ?string $when = null, |
||
| 19 | public ?string $description = null, |
||
| 20 | ) { |
||
| 21 | // Filter and ensure valid commands |
||
| 22 | 19 | $this->commands = array_values(array_filter( |
|
| 23 | 19 | $this->commands, |
|
| 24 | 19 | static fn ($c) => $c instanceof AbstractStandardCommand |
|
| 25 | 19 | )); |
|
| 26 | } |
||
| 27 | |||
| 28 | 12 | public function jsonSerialize(): array |
|
| 42 | } |
||
| 43 | } |
||
| 44 |