Closed
Description
Describe the bug
PHPCS considers methods with name empty
to be incorrect
Code sample
<?php
declare(strict_types=1);
namespace App;
class Foo
{
public function empty()
{
return;
}
}
Custom ruleset
No custom rules. Just PSR12 standard
To reproduce
Steps to reproduce the behavior:
- Create a file called
test.php
with the code sample above... - Run
phpcs --standard=PSR12 test.php
- See error message displayed
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
9 | ERROR | Expected "function abc(...)"; found "function abc(...)"
----------------------------------------------------------------------
If you change method name to basically anything else - empty1
, createEmpty
etc - there is no error
Expected behavior
No complains.
Versions (please complete the following information):
- OS: Ubuntu 20.04
- PHP: 8.1.6
- PHPCS: 3.7.0
- Standard: PSR12