private function exec($cmd) { $proc = new Process($cmd); $exitCode = $proc->run(); if ($exitCode !== 0) { throw new \RuntimeException(sprintf('Could not execute command: %s', $proc->getErrorOutput())); } }