-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Describe the bug
When empty
(or isset
, unset
) is used as method name, phpcs doesn't recognize it and produce weird error messages
Code sample
<?php
declare(strict_types=1);
namespace App;
abstract class Temp
{
abstract public function empty(): void;
abstract public function isset(): void;
abstract public function unset(): Temp; // <- another error for CamelCased return type
}
To reproduce
- Create a file called
Temp.php
with the code sample above... - Run
phpcs Temp.php ...
- See error message displayed
FILE: Temp.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
9 | ERROR | Expected "function abc(...)"; found "function abc(...)"
10 | ERROR | Expected "function abc(...)"; found "function abc(...)"
11 | ERROR | Method name "Temp::Temp" is not in camel caps format
11 | ERROR | Expected "function abc(...)"; found "function abc(...)"
----------------------------------------------------------------------
Expected behavior
No errors OR message about inappropriate method name
Versions (please complete the following information):
- OS: Linux 5.17.12-200.fc35.x86_64
- PHP: 8.1.7
- PHPCS: 3.7.0
- Standard: PSR12
Metadata
Metadata
Assignees
Labels
No labels