nette-intellij / intellij-nette

Nette support in PhpStorm - Develop Nette with pleasure
http://plugins.jetbrains.com/plugin?pluginId=7231
75 stars 6 forks source link

IDE complains when accessing private properties with getter using Nette\Object magic #21

Closed maryo closed 8 years ago

maryo commented 9 years ago

Given there is this code.

class Foo extends Nette\Object
{
    private $bar;

    public function getBar()
    {
        return $this->bar;
    }
}

$foo = new Foo;
echo $foo->bar; // IDE complains "Member has private access, but class has magic method __get"

I think it would be better if this message did not appear since the class has the getter. Is it a good idea, bad idea or a bug? OfC I'm not sure it's easy/possible to do.

matej21 commented 9 years ago

It is not easy to suppress this messages, but I will try :)

matej21 commented 8 years ago

Magic properties without @property annotation are deprecated since nette 2.4, so this issue is not relevant anymore.