Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 3.7.0 methods named empty are failing Squiz.Functions.FunctionDeclaration.Found #3613

Closed
bburnichon opened this issue Jun 14, 2022 · 6 comments

Comments

@bburnichon
Copy link

Describe the bug
A clear and concise description of what the bug is.

Code sample

<?php

namespace Foo;

class Foo
{
    public function empty(): bool
    {
        return true;
    }
}

Custom ruleset
Using PSR12 ruleset

To reproduce
Steps to reproduce the behavior:

  1. Create a file called Foo.php with the code sample above...
  2. Run phpcs --standard=psr12 Foo.php
  3. See error message displayed
$ ./vendor/bin/phpcs --standard=psr12 -s Foo.php 

FILE: /projects/PHPCS_Issue/Foo.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 7 | ERROR | Expected "function abc(...)"; found "function abc(...)"
   |       | (Squiz.Functions.FunctionDeclaration.Found)
-----------------------------------------------------------------------------------------------------------------

Time: 49ms; Memory: 14MB

Expected behavior
No error should occur. It wasn't with previous version

Versions (please complete the following information):

  • OS: Linux
  • PHP: 7.4
  • PHPCS: 3.7.0
  • Standard: PSR12

Additional context
Detected by my CI when upgrading PHPCodesniffer to latest release

@jrfnl
Copy link
Contributor

jrfnl commented Jun 14, 2022

Duplicate of #3609 (and #3611 and #3612), which has already been fixed via #3610.

@dragosprotung
Copy link

@jrfnl any change to get a new version tagged ?

@jrfnl
Copy link
Contributor

jrfnl commented Jun 14, 2022

@dragosprotung Not up to me, but I suspect that a new version will be tagged relatively soon. May still be a few days/a week to give people the chance to report any other issues with the 3.7.0 release (and to get those fixed if needed).

@gsherwood
Copy link
Member

What @jrfnl said. Just want to see if anything else comes up over the next day or so.

@janedbal
Copy link

@gsherwood What is wrong tagging it asap? You can tag it again if you find new bugs after the first tag is released, there is nothing wrong with it.

@gsherwood
Copy link
Member

@janedbal @dragosprotung You'll both be happy to know I've tagged a release. 3.7.1 is now available with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants