-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Match arm comparison between *NEVER* and .... #25
Comments
The What is the output of? function (Builder $q, string $morph) use ($value) {
\PHPStan\dumpType($morph);
$column = match ($morph) {
//... Also, are your morphs class strings or do you override the morph map? |
It Is inside the whereHasMorph method... I'll post output asap
Il ven 31 gen 2025, 15:20 Caleb White ***@***.***> ha scritto:
… The never type means that something is wrong and the type isn't known.
What is the output of?
function (Builder $q, string $morph) use ($value) {
\PHPStan\dumpType($morph);
$column = match ($morph) {
//...
Also, are your morphs class strings or do you override the morph map?
—
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPZLPKLXHMN4ZCTCXHLEVL2NOBB7AVCNFSM6AAAAABWG7PBBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRXGQ3DONZTGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This is full code /** @return Builder<Opportunity> */
public function search(string $value): Builder
{
return $this->builder->where(function (Builder $q) use ($value) {
$q->whereHasMorph(
'owner',
[Customer::class, Lead::class],
function (Builder $q, string $morph) use ($value) {
\PHPStan\dumpType($morph); // <--- *NEVER*
$column = match ($morph) {
Customer::class,
Lead::class => 'fullname',
default => null
};
if ($column !== null) {
$q->where($column, 'like', "%$value%");
}
}
);
});
} I can say that every In this case /** @return MorphTo<EloquentModel, $this> */
public function owner(): MorphTo
{
return $this->morphTo();
} |
@makroxyz, this can be fixed in the framework |
Description
Match arm comparison between NEVER and 'Domain\Registry\Models\Customer' is always false.
match.alwaysFalse
Match arm comparison between NEVER and 'Domain\Registry\Models\Lead' is always false.
match.alwaysFalse
I've tried almost everything... always same error. How can I solve?
Laravel code where the issue was found
The text was updated successfully, but these errors were encountered: