refactor: modernize syntax and simplify code#2371
Merged
Merged
Conversation
…ing interpolation, remove PHP closing tags, and improve code style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some of the changes include replacing array() with [] and simplifying a few array_merge usages. Based on a question I asked on Discord, the project's minimum version is expected to be PHP 8.x, so I plan to introduce further improvements soon to take advantage of more modern syntax.
If this PR gets approved, I’ll continue applying these changes across other files — from what I’ve seen, there are around 999 files that still need these updates, along with a few additional improvements.
I would also like clarification regarding the minimum supported PHP version: should the project continue supporting PHP 8.x (8.0+), or would it be possible to raise it to PHP 8.3+ or even 8.4+, considering their longer support lifecycle and ongoing security updates?
Finally, since we’re already moving in this direction, I’d like to suggest that @remdex starts using [] instead of array() going forward. This will help keep the codebase consistent. For now, I’m not changing any logic — just focusing on this core cleanup of array() and array_merge, which are heavily used throughout the project.