Skip to content

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Feb 3, 2025

/\R+/ matches any type of line break, including:

  • \n (LF - Unix/Linux)
  • \r\n (CRLF - Windows)
  • \r (CR - old macOS)
  • Other uncommon variations

PREG_SPLIT_NO_EMPTY: Prevents empty elements in the result when consecutive line breaks are found

NOTE: Same as dirty

$dirtyFiles = collect(preg_split('/\R+/', $process->getOutput(), flags: PREG_SPLIT_NO_EMPTY))

@taylorotwell taylorotwell merged commit 4182de5 into laravel:main Feb 5, 2025
8 checks passed
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