Merge "user: Allow "CAS update failed" exceptions to be normalised"
[lhc/web/wiklou.git] / includes / shell / Result.php
index c1429df..a105cd1 100644 (file)
@@ -32,13 +32,18 @@ class Result {
        /** @var string */
        private $stdout;
 
+       /** @var string|null */
+       private $stderr;
+
        /**
         * @param int $exitCode
         * @param string $stdout
+        * @param string|null $stderr
         */
-       public function __construct( $exitCode, $stdout ) {
+       public function __construct( $exitCode, $stdout, $stderr = null ) {
                $this->exitCode = $exitCode;
                $this->stdout = $stdout;
+               $this->stderr = $stderr;
        }
 
        /**
@@ -58,4 +63,14 @@ class Result {
        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;
+       }
 }