[12.x] Refactor: Remove unnecessary variables in Str class methods #54963
+2
−2
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.
Refactor: Remove unnecessary variables in Str class methods 🧹
In this PR, I've made two small refactoring improvements to remove unnecessary variables: ✨
Replaced the null coalescing assignment operator (
??=
) with the standard null coalescing operator (??
) in theStr::wrap
method, as the variable is not used after the operation. 🔄Removed the unused exception variable in the
isUuid
method's try-catch block by using PHP 8.0's variable-less catch syntax. 🪄These changes eliminate unused variables and improve code readability while maintaining the exact same functionality. Removing unnecessary variables contributes to better code maintenance and reduces potential confusion for developers reading the code. 📝
The modifications are minimal and focused on code quality improvements only. 🚀