-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[11.x] Use Str::wrap() instead of nesting Str::start() inside Str::finish() #53987
[11.x] Use Str::wrap() instead of nesting Str::start() inside Str::finish() #53987
Conversation
It does indeed seem unnecessary to reassign the I guess it's some leftovers from a previous change. Perhaps |
Would make sense, but—I checked it real quick—nope, it's always been this way (since 8ea50bc) 🤔 @stevebauman Is there a reason behind that, that we are missing or can the equal sign be removed? |
Hey @shaedrich isn't |
@tontonsb Oh, you are right 🤦🏻 👍🏻 Shouldn't there be a method for that? But |
@shaedrich unfourtunately I don't have a nice solution for this. In other places (collections and Arr) I looked into the history and found Str::wrap('\_(ツ)_/', '¯'); // ¯\_(ツ)_/¯
Str::wrap('¯\_(ツ)_/¯', '¯'); // ¯\_(ツ)_/¯
Str::surround('¯\_(ツ)_/¯', '¯'); // ¯¯\_(ツ)_/¯¯ But it doesn't seem appropriate to move the existing behaviour to another name... |
@shaedrich Apologies for the late reply I wasn't the one to initially PR And then I moved it here: |
Btw, is there a reason, why the null coalescing assignment operator is used instead of just the null coalescing operator?
framework/src/Illuminate/Support/Str.php
Lines 441 to 452 in 5d81b45