Skip to content

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