/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/shell/Commands/Collections/Commands.php
34 строки
725 B
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace common\shell\Commands\Collections; use InvalidArgumentException; use common\shell\Commands\CommandInterface; class Commands implements CommandInterface { public const string C_AND = '&&'; public const string C_OR = '||'; private array $commands; private mixed $type; public function __construct(array $commands, $type = self::C_AND) { foreach ($commands as $command) { if (!$command instanceof CommandInterface) { throw new InvalidArgumentException('$commands must be an array of CommandInterface'); } } $this->commands = $commands; $this->type = $type; } public function __toString() { return implode(" $this->type ", $this->commands); } }