klesun / deep-assoc-completion

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

Autocomplete nested array keys when chain of methods #205

Open Jurigag opened 2 years ago

Jurigag commented 2 years ago

Lets assume such case:

ClassOne
{
    public static function seed(array $data): void
    {
        ClassTwo:seed($data['another']);
    }
}

ClassTwo
{
    public static function seed(array $data): void
    {
        self::something([
            'id' => $data['id'],
            'name' => $data['name'],
        ]);
    }
}

Currently plugin doesn't autocomplete it when using:

ClassOne::seed([
    'another' => [
        'id' => 123 // no autocomplete here
    ]
]);

It would be nice if it could somehow autocomplete this.