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

Typed properties: conflict with @var in non-existent phpdoc #2363

Closed
rainbow-alex opened this issue Aug 15, 2019 · 4 comments
Closed

Typed properties: conflict with @var in non-existent phpdoc #2363

rainbow-alex opened this issue Aug 15, 2019 · 4 comments
Labels
Milestone

Comments

@rainbow-alex
Copy link

Bug report

Code snippet that reproduces the problem

<?php

namespace Foo;

class Bar
{
    private \stdClass $test;
}

(playground does not yet support 7.4)

7 PHPDoc tag @var for property Foo\Bar::$test with type mixed is not subtype of native type stdClass.

Expected output

No errors reported.

@mergeable
Copy link

mergeable bot commented Aug 15, 2019

This bug report is missing a link to reproduction on phpstan.org.
It will most likely be closed after manual review.

@rainbow-alex
Copy link
Author

When I add /** @var \stdClass */, the error goes away, but I obviously don't want to have to add these redundant doc comments everywhere...

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Aug 15, 2019
@ondrejmirtes
Copy link
Member

ondrejmirtes commented Aug 15, 2019

Yes, this is a bug, thank you. Somehow it didn't occur to me to test this scenario in the right rule :)

@ondrejmirtes
Copy link
Member

Fixed, thanks! 89cf4b1

@lock lock bot locked as resolved and limited conversation to collaborators Dec 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants