tests: Prefer assertSame() when comparing the integer 0
[lhc/web/wiklou.git] / includes / shell / Command.php
index 7742075..60eae42 100644 (file)
@@ -429,7 +429,8 @@ class Command {
 
                        // clear get_last_error without actually raising an error
                        // from https://www.php.net/manual/en/function.error-get-last.php#113518
-                       // TODO replace with clear_last_error when requirements are bumped to PHP7
+                       // TODO replace with error_clear_last after dropping HHVM
+                       // @phan-suppress-next-line PhanTypeMismatchArgumentInternal
                        set_error_handler( function () {
                        }, 0 );
                        AtEase::suppressWarnings();
@@ -446,8 +447,9 @@ class Command {
                        // 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.
-                       // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
-                       $numReadyPipes = @stream_select( $writePipes, $readPipes, $emptyArray, $timeout );
+                       AtEase::suppressWarnings();
+                       $numReadyPipes = stream_select( $writePipes, $readPipes, $emptyArray, $timeout );
+                       AtEase::restoreWarnings();
                        if ( $numReadyPipes === false ) {
                                $error = error_get_last();
                                if ( strncmp( $error['message'], $eintrMessage, strlen( $eintrMessage ) ) == 0 ) {