flyntwp / flynt

Component based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
https://flyntwp.com
MIT License
735 stars 84 forks source link

how to disable php lint for specific line? #316

Closed forevereffort closed 4 years ago

forevereffort commented 4 years ago

Hello @domtra

I am going to use Walker_Comment like the following

class CustomCommentWalker extends Walker_Comment
{
    protected function html5_comment($comment, $depth, $args)
    {
    }
}

after npm run build, I got the php lint issue : Method name "CustomCommentWalker::html5_comment" is not in camel caps format

html5_comment is wordpress standard function. so I can't change that function name. how can I resolve this issue?

Regards

domtra commented 4 years ago

Hi @forevereffort ,

there are multiple ways to do that for any php codesniffer rule. In your case a would suggest

class CustomCommentWalker extends Walker_Comment
{
    protected function html5_comment($comment, $depth, $args) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
    {
    }
}

You can have a look here.