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

ClassMapGenerator: stabilize the heredoc/nowdoc stripping #10072

Merged
merged 7 commits into from Aug 29, 2021

Commits on Aug 21, 2021

  1. ClassMapGeneratorTest: add test with consecutive duplicate heredoc ma…

    …rkers
    
    ... as well as a test with heredoc markers with only a newline character between the start and end marker.
    jrfnl authored and Seldaek committed Aug 21, 2021
    Configuration menu
    Copy the full SHA
    b66b23a View commit details
    Browse the repository at this point in the history
  2. ClassMapGenerator: stabilize the heredoc/nowdoc stripping

    I've looked into 10067 and have come to the conclusion that using a single regex to strip the heredoc/nowdocs is always going to run into trouble as:
    * Either the matching will be too greedy (issue 10067);
    * Or the matching will run into backtrace limits for large heredoc/nowdocs.
    
    We cannot solve both within a single regex.
    
    So, I'm proposing a slightly different solution which should support both and should also improve performance for files containing large heredoc/nowdocs.
    
    The `stripHereNowDocs()` function will find a start marker and remember the offset of the start marker.
    It will then find the end marker and strip the contents between the two (replace with `null`).
    The function will then recurse onto itself until all heredocs/nowdocs in a file have been removed.
    jrfnl authored and Seldaek committed Aug 21, 2021
    Configuration menu
    Copy the full SHA
    40bd4b0 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2021

  1. Configuration menu
    Copy the full SHA
    c44be99 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f6c446b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3f79e59 View commit details
    Browse the repository at this point in the history
  4. Regex simplifications

    Seldaek committed Aug 23, 2021
    Configuration menu
    Copy the full SHA
    6ab1b6a View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2021

  1. Add more possessive quantifiers, unicode flag and support for more po…

    …st-heredoc syntax, fix test file syntax being invalid
    Seldaek committed Aug 29, 2021
    Configuration menu
    Copy the full SHA
    d8054d1 View commit details
    Browse the repository at this point in the history