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

Refactor Lower Case and Upper Case Filters #154

Open
wants to merge 1 commit into
base: 3.0.x
Choose a base branch
from

Conversation

gsteel
Copy link
Member

@gsteel gsteel commented Jun 29, 2024

Q A
Documentation yes
BC Break yes
QA yes

Description

  • Removes AbstractUnicode from the inheritance tree and deletes it
  • Clean up File\LowerCase, File\UpperCase, StringToLower, StringToUpper and UpperCaseWords so that they all implement FilterInterface directly without any inheritance.

All the filters support an encoding option which is re-implemented in each class. Boilerplate is reduced by adding a new internal class EncodingOption for consistent handling of encoding options…

Extracted some duplicated file handling code into an internal class FilterFileContents that applies a filter to the contents of a file.

This removes the need for File\LowerCase to extend StringToLower for example.

- Removes `AbstractUnicode` from the inheritance tree and deletes it
- Clean up `File\LowerCase`, `File\UpperCase`, `StringToLower`, `StringToUpper` and `UpperCaseWords` so that they all implement `FilterInterface` directly without any inheritance.

All the filters support an `encoding` option which is re-implemented in each class. Boilerplate is reduced by adding a new internal class `EncodingOption` for consistent handling of encoding options…

Extracted some duplicated file handling code into an internal class `FilterFileContents` that applies a filter to the contents of a file.

This removes the need for `File\LowerCase` to extend `StringToLower` for example.

Signed-off-by: George Steel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant