/** * {@inheritdoc} */ public function execute(CommandParams $params, CommandExecutionContext $executionContext) { $fileName = $params->getFirstArgument(); if (!$executionContext->hasFileInWorkingDirectory($fileName)) { throw new ExecutionFailedException("File '{$fileName}' does not exist."); } $path = $executionContext->getPathOfFileInWorkingDirectory($fileName); $cmd = sprintf('php %s 2>&1', escapeshellarg($path)); $output = shell_exec($cmd); return $this->wrapOutput($output); }