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

Phan should not emit PhanTypeMismatchProperty for assignments to undeclared dynamic properties #3042

Closed
TysonAndre opened this issue Aug 5, 2019 · 0 comments · Fixed by #3043
Labels
enhancement This improves the quality of Phan's analysis of a codebase

Comments

@TysonAndre
Copy link
Member

Expected: Don't warn

<?php

class MyClass {
    public function __get($key) {}
    public function __set($key, $value) {}
}
function testDynamicProp($arg) {
    $m = new MyClass();
    $m->dynamicProp = null;

    // Observed: PhanTypeMismatchProperty Assigning 1 to property but \MyClass->dynamicProp is null
    $m->dynamicProp = 1;
}
@TysonAndre TysonAndre added the enhancement This improves the quality of Phan's analysis of a codebase label Aug 5, 2019
TysonAndre added a commit to TysonAndre/phan that referenced this issue Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This improves the quality of Phan's analysis of a codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant