-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Stringable
is also an interface of symfony
#51309
[11.x] Stringable
is also an interface of symfony
#51309
Conversation
…models. So if we check a model if a model is filled it except an error: Call to undefined method App\\Model::trim(). So we use now explicit Illuminate\Support\Stringable
You've added an unused The interface is not used in the helpers file, it is only referenced via PHPDoc, so this only adds an unused duplicate of that. |
No: And if I check in the |
Ah.. so this fixes your previous PR #51300 That's the difference, I see, sounds good! |
I believe updating the if ($value instanceof Stringable) {
return trim((string) $value) === '';
} Instead of this: if ($value instanceof \Illuminate\Support\Stringable) {
return $value->trim()->toString() === '';
} Is both faster and solves more use-cases - @taylorotwell thoughts? |
But you're not going to hit strings alà ' '. Thats it why I've added |
Stringable
is also an interface of symfonyStringable
is also an interface of symfony
Okay I've seen, native $value = ' '; //more than one spaces
trim($value) === ''; //true I will change it to native php function. Thx @Jacobs63 |
Stringable
is also an interface of symfony and is implemented on models. So if we check a model if a model is filled it except an error: Call to undefined method App\Model::trim(). So we use now explicit Illuminate\Support\Stringable