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

Nested references don't work in associative arrays #197

Open
1234ru opened this issue Dec 15, 2021 · 0 comments
Open

Nested references don't work in associative arrays #197

1234ru opened this issue Dec 15, 2021 · 0 comments

Comments

@1234ru
Copy link

1234ru commented Dec 15, 2021

I have arrays of items, whose structure is declared, and I reference to that structure in the arrays' declaration.

If the array has implicit or numeric keys, suggestion works fine.

But if the array has string keys, suggestion doesn't work.

<?php

class Test {
    /** @var = [
     *      'one' => '',
     *      'two' => '',
     *  ] */
    public $x;
}

/** @var $a = [ Test::$x ] */
$a = [
    [
        '' // suggests 'one', 'two' as expected
    ]
];

/** @var $b = [ Test::$x ] */
$b = [
    'key' => [
        '' // doesn't suggest anything :(
    ]
];

Is there a way to make such reference work in an associative array?

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

No branches or pull requests

1 participant