laminas / laminas-filter

Programmatically filter and normalize data and files
https://docs.laminas.dev/laminas-filter/
BSD 3-Clause "New" or "Revised" License
85 stars 35 forks source link

Refactor `StripNewlines` filter #167

Closed gsteel closed 2 months ago

gsteel commented 2 months ago
Q A
BC Break yes
QA yes

Description

There's not much to change for this filter because it was already pretty minimal, however, inheritance has been removed.

This patch introduces ScalarOrArrayFilterCallback.

This internal class/static method will be used to replace AbstractFilter::applyFilterOnlyToStringableValuesAndStringableArrayValues

Allows independent unit tests and frees filters from inheritance.

Also improves the previous implementation by recursively processing nested array structures.

gsteel commented 2 months ago

Also see #168