Skip to content

Tag reference

@phpcsSuppress

The @phpcsSuppress tag is pre-3.2.0 PHP_CodeSniffer syntax for suppressing named coding-standard checks; current PHP_CodeSniffer prefers the phpcs:* comment syntax instead, but still understands the older tag-based forms.

Grammar

"@phpcsSuppress" <Name> [ <Description> ]

Examples

Silencing one sniff for an element.
/**
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*/
public function handle($event): void

Names by platform

phpcs
@phpcsSuppress

Parsing a @phpcsSuppress tag produces a PhpcsSuppressTag instance, carrying the parsed $identifier alongside the $name and optional $description every Tag already provides.

final class PhpcsSuppressTag extends IdentifierTag {}

Associated with PHP_CodeSniffer.