Skip to content
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

[10.x] fix Expression string casting #46137

Merged
merged 1 commit into from Feb 16, 2023

Conversation

browner12
Copy link
Contributor

The Expression class no longer provides a __toString() method, so we cannot cast it to a string here.

We'll now use the ->getValue() method and pass the current database connection's query grammar.

#44784

strangely enough, the HasInDatabase::toString() method is only called to get the failure description, but I was getting the unavailable string casting error even without a test failure. this leads me to believe PHPUnit is (sometimes) calling the failureDescription() method even without a failure? Not sure on this.

The `Expression` class no longer provides a `__toString()` method, so we cannot cast it to a string here.

We'll now use the `->getValue()` method and pass the current database connection's query grammar.

laravel#44784
@taylorotwell taylorotwell merged commit 35ce656 into laravel:10.x Feb 16, 2023
@browner12 browner12 deleted the AB-has-in-database branch February 16, 2023 16:04
chu121su12 pushed a commit to chu121su12/framework that referenced this pull request Feb 25, 2023
The `Expression` class no longer provides a `__toString()` method, so we cannot cast it to a string here.

We'll now use the `->getValue()` method and pass the current database connection's query grammar.

laravel#44784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants