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

fails after php tag #3652

Open
ghost opened this issue Aug 18, 2022 · 1 comment
Open

fails after php tag #3652

ghost opened this issue Aug 18, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 18, 2022

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

Some files have errors and cannot be repaired, so the code has been truncated to make it shorter and easier to understand.

I don't know if it's a bug or not.
But other tools don't fail.

phpcbf --version
PHP_CodeSniffer version 3.7.1 (stable) by Squiz (http://www.squiz.net)

Code sample

<?php

function test()
{
?> <?php

printf("%d",
1);
}

To reproduce
Steps to reproduce the behavior:

  1. Create a file called test.php with the code sample above...
  2. Run phpcs test.php ...
  3. See error message displayed

PHPCS output here

C:\tmp>phpcbf --standard=PSR2 -v text2.php
Registering sniffs in the PSR2 standard... DONE (43 sniffs registered)
Creating file list... DONE (1 files in queue)
Changing into directory C:\tmp
Processing text2.php [PHP => 28 tokens in 9 lines]... DONE in 24ms (4 fixable violations)
        => Fixing file: 1/4 violations remaining [made 50 passes]... ERROR in 551ms

PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
C:\tmp\text2.php                                      FAILED TO FIX
----------------------------------------------------------------------
A TOTAL OF 3 ERRORS WERE FIXED IN 1 FILE
----------------------------------------------------------------------
PHPCBF FAILED TO FIX 1 FILE
----------------------------------------------------------------------

Time: 826ms; Memory: 8MB

@jrfnl
Copy link
Contributor

jrfnl commented Aug 18, 2022

Confirmed as reproducable.

Looks like a fixer conflict between the Generic.WhiteSpace.ScopeIndent sniff and the PEAR.Functions.FunctionCallSignature sniff.

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

1 participant