You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had Expected type 'App\Models\BalanceActivity'. Found 'Illuminate\Database\TReturn' kind of IDE errors after I upgrade my dependencies minor versions.
I was not sure about the problem is about Intellephense or Laravel or ide-helper then I tried changing the _ide_helper.php file. Notice the return line in docblock.
Before:
/** * * * @template TReturn of mixed * * Execute a Closure within a transaction. * @param (\Closure(static): TReturn) $callback * @param int $attempts * @return \Illuminate\Database\TReturn * @throws \Throwable * @static */publicstaticfunctiontransaction($callback, $attempts = 1)
{ //Method inherited from \Illuminate\Database\Connection /** @var \Illuminate\Database\PostgresConnection $instance */return$instance->transaction($callback, $attempts);
}
After:
/** * * * @template TReturn of mixed * * Execute a Closure within a transaction. * @param (\Closure(static): TReturn) $callback * @param int $attempts * @return TReturn * @throws \Throwable * @static */publicstaticfunctiontransaction($callback, $attempts = 1)
{ //Method inherited from \Illuminate\Database\Connection /** @var \Illuminate\Database\PostgresConnection $instance */return$instance->transaction($callback, $attempts);
}
All the issues are gone now. I was planning to open a PR but could not find how this code is generated.
The text was updated successfully, but these errors were encountered:
Versions:
Description:
I had
Expected type 'App\Models\BalanceActivity'. Found 'Illuminate\Database\TReturn'
kind of IDE errors after I upgrade my dependencies minor versions.Same happens if I add return type hint to DB::transaction parameter:
Signature for unsafeCreate method:
I was not sure about the problem is about Intellephense or Laravel or ide-helper then I tried changing the
_ide_helper.php
file. Notice the return line in docblock.Before:
After:
All the issues are gone now. I was planning to open a PR but could not find how this code is generated.
The text was updated successfully, but these errors were encountered: