[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