From: D3r1ck01 Date: Wed, 19 Dec 2018 17:15:17 +0000 (+0000) Subject: Merge "Use MediaWiki\SuppressWarnings around trigger_error('') instead @" X-Git-Tag: 1.34.0-rc.0~3217 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09 Merge "Use MediaWiki\SuppressWarnings around trigger_error('') instead @" --- 0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09 diff --cc includes/shell/Command.php index 1154e05886,7b21c06ebf..2afc548d08 --- a/includes/shell/Command.php +++ b/includes/shell/Command.php @@@ -433,16 -433,17 +433,17 @@@ 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 ) { + $readPipes = array_filter( $pipes, function ( $fd ) use ( $desc ) { return $desc[$fd][0] === 'pipe' && $desc[$fd][1] === 'r'; - } ); - $writePipes = wfArrayFilterByKey( $pipes, function ( $fd ) use ( $desc ) { + }, ARRAY_FILTER_USE_KEY ); + $writePipes = array_filter( $pipes, function ( $fd ) use ( $desc ) { return $desc[$fd][0] === 'pipe' && $desc[$fd][1] === 'w'; - } ); + }, ARRAY_FILTER_USE_KEY ); // stream_select parameter names are from the POV of us being able to do the operation; // proc_open desriptor types are from the POV of the process doing it. // So $writePipes is passed as the $read parameter and $readPipes as $write.