-
Notifications
You must be signed in to change notification settings - Fork 661
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
False positive MethodSignatureMustProvideReturnType with stubs. #7518
Comments
Hey @VincentLanglet, can you reproduce the issue on https://psalm.dev ? |
@bendavies made a similar claim a while ago psalm/psalm-plugin-symfony#146
It could be the same bug that is now revealed Should we disable this feature/Issue and release a new bugfix version until we can find and fix the issue? |
I understand the issue here now and have a way forward. I'll try this weekend |
Cool! Glad to hear that! |
As a quick fix, shouldn't the |
well, i spent a bit of time on this over the weekend and the bug i was looking at as part of psalm/psalm-plugin-symfony#146 is no longer reproducable. there still is a bug here which i discussed with @orklah . i think the way forward is understood. @orklah could probably give a better summary as he understands the psalm internals better than me |
After upgrading from 4.17 to 4.19, we're seeing unexpected # app/Http/Requests/Customer/IndexCustomerRequest.php
<?php
namespace App\Http\Requests\Customer;
use App\Models\Customer;
use App\Models\Team;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
/**
* @property-read Team $team
* @method User user($guard = null)
*/
class IndexCustomerRequest extends FormRequest
{
// ...
} Weirdly, the declared |
@caugner This might be a cache issue, try removing the psalm cache and running psalm with |
@danog This was also happening on fresh CI runs. |
scrap that, reproduced it again |
I tried playing around a bit, replacing the $storage->user_defined = true;
if (class_exists($fq_classlike_name)) {
$reflect = new ReflectionClass($fq_classlike_name);
$storage->user_defined = !$reflect->isInternal();
} However I haven't yet managed to reproduce the original issue in the stub tests, but maybe this can help you @bendavies |
I released a new version. Sorry, I didn't make it a bugfix (mainly because I have no idea how >< ) This should be solved for now, we'll try to find a solution to enable it again at a later date (probably be on Psalm 5 at this point) |
You check out a tag (say, |
In 4.19, the
MethodSignatureMustProvideReturnType
error was introduced.In the following project sonata-project/EntityAuditBundle#474, I now have errors like:
Removing the doctrine plugin
solve my issue.
So it would means that the Collection stub provided by the plugin is considered as a native php interface.
Related to #7363
cc @weirdan @orklah @danog
The text was updated successfully, but these errors were encountered: