/** * Clone command */ public function __clone() { parent::__clone(); $commandList = array(); foreach ($this->commandList as $command) { $commandList[] = clone $command; } $this->commandList = $commandList; }