Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@janedbal
Copy link

  • bug fix
  • BC break? no

  • When using custom indents (spaces) and block mode, inner part of block strings were always indented with tab.
  • This showed up in our git-based whitespace check in pre-commit (git diff-index --check --cached HEAD -- $FILES) as space before tab in indent error.
  • The real usecase is PHPStan baseline of deprecated usages where newline is very often.

Before:

inner:
    msg: '''
    	string
    	with newline
    '''

After this fix:

inner:
    msg: '''
        string
        with newline
    '''

@janedbal
Copy link
Author

@dg Any chance you find a minute to look at this? Thank you

@dg dg force-pushed the master branch 2 times, most recently from 30032d8 to 90a0d3f Compare June 18, 2025 19:35
@dg
Copy link
Member

dg commented Jun 19, 2025

Wouldn't it be easier to solve it in StringNode using property $indentation as in BlockArrayNode?

@janedbal
Copy link
Author

Wouldn't it be easier to solve it in StringNode using property $indentation as in BlockArrayNode?

Tried in #78, but StringNode is also created in Parser::parseValue where I was not sure how to get the indent properly...

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

Successfully merging this pull request may close these issues.

2 participants