Path: blob/master/src/applications/drydock/exception/DrydockCommandError.php
12256 views
<?php12final class DrydockCommandError extends Phobject {34private $phase;5private $displayCommand;6private $command;7private $error;8private $stdout;9private $stderr;1011public static function newFromCommandException(CommandException $ex) {12$error = new self();1314$error->command = (string)$ex->getCommand();1516$error->error = $ex->getError();17$error->stdout = $ex->getStdout();18$error->stderr = $ex->getStderr();1920return $error;21}2223public function setPhase($phase) {24$this->phase = $phase;25return $this;26}2728public function getPhase() {29return $this->phase;30}3132public function setDisplayCommand($display_command) {33$this->displayCommand = (string)$display_command;34return $this;35}3637public function getDisplayCommand() {38return $this->displayCommand;39}4041public function toDictionary() {42$display_command = $this->getDisplayCommand();43if ($display_command === null) {44$display_command = $this->command;45}4647return array(48'phase' => $this->getPhase(),49'command' => $display_command,50'raw' => $this->command,51'err' => $this->error,52'stdout' => $this->stdout,53'stderr' => $this->stderr,54);55}5657}585960