Use MediaWiki\SuppressWarnings around trigger_error('') instead @
authorMark A. Hershberger <mah@nichework.com>
Mon, 2 Apr 2018 22:22:42 +0000 (18:22 -0400)
committerMarkAHershberger <mah@nichework.com>
Tue, 17 Apr 2018 16:34:00 +0000 (16:34 +0000)
The @ sign requires a phpcs:ignore.

\MediaWiki\suppressWarnings() doesn't need a phpcs:ignore.

Bug: T191247
Change-Id: I6ef1e706f4f2a4192dde7a668b3b97086a4a8a68

includes/shell/Command.php

index d9fa82d..7b21c06 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( '' );
+                       \MediaWiki\suppressWarnings();
+                       trigger_error( '' );
+                       \MediaWiki\restoreWarnings();
                        restore_error_handler();
 
                        $readPipes = wfArrayFilterByKey( $pipes, function ( $fd ) use ( $desc ) {