Update AtEase calls to use Wikimedia namespace
[lhc/web/wiklou.git] / includes / shell / Command.php
index 1154e05..1936d00 100644 (file)
@@ -433,8 +433,9 @@ class Command {
                        // TODO replace with clear_last_error when requirements are bumped to PHP7
                        set_error_handler( function () {
                        }, 0 );
-                       // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
-                       @trigger_error( '' );
+                       \Wikimedia\suppressWarnings();
+                       trigger_error( '' );
+                       \Wikimedia\restoreWarnings();
                        restore_error_handler();
 
                        $readPipes = array_filter( $pipes, function ( $fd ) use ( $desc ) {
@@ -552,4 +553,15 @@ class Command {
 
                return new Result( $retval, $buffers[1], $buffers[2] );
        }
+
+       /**
+        * Returns the final command line before environment/limiting, etc are applied.
+        * Use string conversion only for debugging, don't try to pass this to
+        * some other execution medium.
+        *
+        * @return string
+        */
+       public function __toString() {
+               return "#Command: {$this->command}";
+       }
 }