-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FunctionSignature and ScopeIndent sniffs don't detect indents correctly when PHP open tag is not on a line by itself #645
Comments
This looks to be something specific to this WordPress coding standard and the combinations of sniffs it is using as I can't replicate it on included standards. So I'll need a bit of time to look into it. The conflicting fixes are from the Generic scope indent sniff though, so I'll need to see how these settings have been overridden in the WordPress standard:
Using a tab-width of 4, which is recommended, gives these conflicts instead (still related):
|
Smallest bit of sample code I can get to reproduce the error:
|
…t indents correctly when PHP open tag is not on a line by itself
This is now working for me on the master branch. |
@gsherwood bump, when the code in the master branch? |
Already in the master branch, will be released soon, when I get some time. Forgot to close this report. Closing now. |
@gsherwood use last version <div>
<?php getTemplatePart(
'partials/web-page/carousel-slick/item-slide/header',
[
'class' => $class
]
); ?>
</div> but use this code, not contain error <div>
<?php
getTemplatePart(
'partials/web-page/carousel-slick/item-slide/header',
[
'class' => $class
]
);
?>
</div> |
…mixed HTML/PHP code blocks (ref #645)
@evilebottnawi I've fixed this now. Will be in the next release (no date set). |
I'm using version 2.5.1 and i'm also having the same problem. has there been a regression? |
The tests are all still passing, so there are no known regressions. Do you have some sample code you can post to explain the error you are seeing? And the command you are running, coding standard you are using, that sort of thing? |
…r-php-yield-from-add-tests+minor-bug-fix Tokenizer/PHP: add tests for tokenization of yield and yield from + minor bug fix
When inspecting
co-authors-plus.php
with theWordPress-VIP
ruleset, phpcbf takes a long time to finish and fails to fix any problems:The file in question:
https://github.com/Automattic/Co-Authors-Plus/blob/57236fc6856b715d5e27248f6eea5681153645aa/co-authors-plus.php
Here's the output of phpcbf:
Here's the output of phpcs:
The text was updated successfully, but these errors were encountered: