Ignoring unused parameter with code sniffer

I was able to hide the dirt under the rug like this:

// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) 
{
// @codingStandardsIgnoreEnd
....
}

I'm not proud of it, but it works.


Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:

/**
 * {@inheritdoc}
 */
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    //my install script here that does not use the parameter $context
}

I'm pretty sure the suppress warning rule you will have to use is:

Generic.CodeAnalysis.UnusedFunctionParameter

So this should be the code to use in your PHP Docblock:

@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)