Skip to content

Generators/Text: various minor code simplifications #824

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

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 16, 2025

Description

Generators/Text: minor simplification

No need for multiple calls to str_replace() when a single call will do.

Generators/Text::getFormattedTextBlock(): simplify the logic

There's absolutely no need for custom word-wrapping logic when PHP contains a function which can do this perfectly well.

Suggested changelog entry

N/A

Related issues/external references

This PR is part of a series of PRs which will add a complete set of tests (and improvements) for the Generator feature.

Also see: #671 and other PR with the Core Component: Generators label.

No need for multiple calls to `str_replace()` when a single call will do.
There's absolutely no need for custom word-wrapping logic when PHP contains a function which can do this perfectly well.
@jrfnl jrfnl merged commit a97683d into master Feb 19, 2025
59 checks passed
@jrfnl jrfnl deleted the feature/generators-text-various-simplifications branch February 19, 2025 10:29
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.

2 participants