Page MenuHomeWickedGov Phorge

UnboxedResult.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

UnboxedResult.php

<?php
namespace Shellbox\Command;
class UnboxedResult {
/** @var int|null */
private $exitCode;
/** @var string|null */
private $stdout;
/** @var string|null */
private $stderr;
/**
* Set the exit code
*
* @param int $exitCode
* @return $this
*/
public function exitCode( $exitCode ) {
$this->exitCode = $exitCode;
return $this;
}
/**
* Set the stdout contents
*
* @param string $stdout
* @return $this
*/
public function stdout( $stdout ) {
$this->stdout = $stdout;
return $this;
}
/**
* Set the stderr contents
*
* @param string $stderr
* @return $this
*/
public function stderr( $stderr ) {
$this->stderr = $stderr;
return $this;
}
/**
* Combine another result with this one. The semantics are like the shell's
* "&&" operator, although in practice we use this to upgrade an
* UnboxedResult to a BoxedResult, so $this is typically empty.
*
* @param UnboxedResult $other
*/
public function merge( UnboxedResult $other ) {
if ( !$this->exitCode ) {
$this->exitCode = $other->exitCode;
}
$this->stdout .= $other->getStdout();
$this->stderr .= $other->getStderr();
}
/**
* Returns exit code of the process
*
* @return int|null
*/
public function getExitCode() {
return $this->exitCode;
}
/**
* Returns stdout of the process
*
* @return string|null
*/
public function getStdout() {
return $this->stdout;
}
/**
* Returns stderr of the process or null if the Command was configured to add stderr to stdout
* with includeStderr( true )
*
* @return string|null
*/
public function getStderr() {
return $this->stderr;
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 3 2026, 00:49 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a3/d5/58b4e7f0d7898e9f4f001fbef8aa
Default Alt Text
UnboxedResult.php (1 KB)

Event Timeline