-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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.phpwith 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
bronek89, baci266, jakubkosinski99, Arthur-Sk, dragosprotung and 1 morejakubkosinski99 and bronek89bronek89