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

PHP open/close tags inside CSS files are replaced with internal PHPCS token strings when auto fixing #2467

Closed
dakanji opened this issue Mar 29, 2019 · 2 comments
Milestone

Comments

@dakanji
Copy link

dakanji commented Mar 29, 2019

PHP tokens are changed to program tokens but are not changed back when the appear in comment blocks

PHP version:

PHP 7.1.1 (cli) (built: Feb 13 2017 10:05:49) ( NTS )

PHP_CodeSniffer version:

PHP_CodeSniffer version 3.4.0 (stable) by Squiz (http://www.squiz.net)

Minimum samples of PHP code:

  • ... before running PHP_CodeSniffer:
/* <?php $varName = $ourClass->ourFunc('Some Test'); ?>
 * Some Txt
 */
  • ... with unexpected changes applied when running PHP_CodeSniffer:
/* ^PHPCS_CSS_T_OPEN_TAG^ $varName = $ourClass->ourFunc('Some Test'); ^PHPCS_CSS_T_CLOSE_TAG^
 * Some Txt
 */
  • .... with the changes expected:
// No Change
@dakanji dakanji changed the title PHP tokens not changed back when commented out PHP tokens not changed back when in comment block Mar 29, 2019
@dakanji
Copy link
Author

dakanji commented Mar 29, 2019

PS. Only seems to happen when the commented PHP code is in a *.css file

@gsherwood gsherwood changed the title PHP tokens not changed back when in comment block PHP open/close tags inside CSS files are replaced with internal PHPCS token strings when auto fixing Apr 1, 2019
@gsherwood gsherwood added this to the 3.4.2 milestone Apr 1, 2019
gsherwood added a commit that referenced this issue Apr 1, 2019
…ith internal PHPCS token strings when auto fixing
@gsherwood
Copy link
Member

This will be fixed in 3.4.2. Thanks for reporting it.

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

No branches or pull requests

2 participants