DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
83 stars 10 forks source link

False positive results between trait and `@mixin` #668

Closed ging-dev closed 2 months ago

ging-dev commented 2 months ago
<?php

/**
 * @mixin B
 */
trait Bug {
    function test() {
        $this->foo();
        echo $this->bar; // Member has private visibility and is not accessible from the current context.PHP(PHP1416)
    }
}

class B {
    use Bug;
    private int $bar = 1;

    public function foo() {

    }
}

(new B)->test();

Related bug: When trait and @mixin are in the vendor, it will not autocomplete or display hover about the private/protected properties of the mixed-in class.

jakubmisek commented 2 months ago

Thanks! fixed, also the code completion did not show the private members from mixins.