I've proposed at T253461 that we phase out our AtEase library in favour of PHP's regular error suppression methods.
Based on the feedback gathered on the task so far, I think it's preferred that we continue to generally discourage use of error suppression (regardless of whether through @
, AtEase
, or error_reporting
).
As such, I proposed that we keep the conventions mostly as-is, including that our PHPCS rule warns against use of the @-operator. What would change is that we'd use that same PHPCS rule as our way of opt-ing to it as-needed.
Currently:
use Wikimedia\AtEase\AtEase;
AtEase::suppressWarnings();
$content = file_get_contents( $path );
AtEase::restoreWarnings();
Now:
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
$content = @file_get_contents( $path );