Errors of an expression are silenced with @
What it finds
@file_get_contents($url): the @ operator hides every warning and notice of the expression, including the ones that explain a failure, and makes the failure surface later and elsewhere. Check the result and handle the error instead.
From the rule's source, error_suppression.rs.
<?phpfunction read($path){ $text = @file_get_contents($path);tx0 reports: the errors of file_get_contents($path) are silenced return $text === false ? '' : $text;} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:error-suppression" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:error-suppression] reason="..."tx0 explain tx0/php:error-suppression shows the same in the terminal. Found a false positive? Report it.