$command], $args)); $input->setInteractive(false); $temp_stream = fopen($outputFile, 'wb+'); if (false === $temp_stream) { throw new \RuntimeException(sprintf('Could not open output file: "%s"', $outputFile)); } $output = new StreamOutput($temp_stream); $command = $this->find($command); $result_code = $command->run($input, $output); rewind($temp_stream); $result_output = stream_get_contents($temp_stream); fclose($temp_stream); $result_output = trim((string)$result_output); return [ $result_code, $result_output, ]; } }