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

Miss parameter from parent's phpdocs when return provided #4931

Closed
snapshotpl opened this issue Jan 4, 2021 · 3 comments
Closed

Miss parameter from parent's phpdocs when return provided #4931

snapshotpl opened this issue Jan 4, 2021 · 3 comments

Comments

@snapshotpl
Copy link
Contributor

https://psalm.dev/r/d1158f23fb

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/d1158f23fb
<?php
interface Adapter
{
    /** @param int $offset */
    public function items($offset): array;
}

class Implementation2 implements Adapter
{
    public function items($offset): array
    {
        return [];
    }  
}

class Implementation implements Adapter
{
    /** @return array */
    public function items($offset): array
    {
        return [];
    }  
}
Psalm output (using commit b3b2389):

INFO: MissingParamType - 19:27 - Parameter $offset has no provided type

@weirdan
Copy link
Collaborator

weirdan commented Jan 4, 2021

This is possibly due to the fix for #4537

@muglug
Copy link
Collaborator

muglug commented Jan 5, 2021

Yes, this is by design. It’s essentially impossible to mix-and-match docblocks.

@muglug muglug closed this as completed Jan 5, 2021
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

No branches or pull requests

3 participants