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

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

Open
1234ru opened this issue Dec 7, 2021 · 1 comment
Open

Comments

@1234ru
Copy link

1234ru commented Dec 7, 2021

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
Copy link
Author

1234ru commented Feb 16, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants