Fix TypeError and refactor processors #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of the current processors caused one of our CI steps to fail like this during the build:
I didn't really try reproducing that locally (too much hassle), but my first instinct is to blame current code of the Processor in question, which first converts the whole array into a JSON string, then performs a
preg_replace_callback
on that string, and then attempts to convert the string back to an array, and doesn't even check the result. Thus I decided to refactor these processors to employ a cycle and a recursion instead. While doing this, I also noticed that the code of both of the processors is basically the same, with the exception of the regex that is used. So I figured why not move everything into the abstract class and just have a single constant in both final processors. WDYT?BTW, I also have a separate branch where I'm working on Monolog 3 support, but Seldaek/monolog#1680 is currently blocking me. :)