klesun / deep-assoc-completion

A phpstorm plugin for associative array key typing and completion
Other
267 stars 17 forks source link

Reference to other namespace doesn't work inside of class definition #196

Open 1234ru opened 2 years ago

1234ru commented 2 years ago

In the example below the method Test2\B\getClient() doesn't recognize a reference in it's declaration, while same reference works fine for standalone variable $x:

<?php

namespace Test {

    class A
    {
        /** @var = [
         *      'name' => '',
         *      'phone' => '',
         *  ]
         */
        public $client;
    }

}

namespace Test2 {

    class B
    {     
        /** @return = \Test\A::$client */
        public function getClient() {
            return [
                '' // 'name' or 'phone' is expected, but there is no suggestions
            ];
        }
    }
}

/** @var $x = \Test\A::$client */
$x = [
    // here suggestion does work
];
1234ru commented 2 years ago

I found out that it doesn't work particularly in @return tag, but it does work in @param and @var.