deep-assoc-completion

Compatible with: IntelliJ IDEA PhpStorm
Mar 09, 2019
28 371
  • PHP associative array auto-completion inferred from other functions (in other files).
  • Go To key Definition.
  • Specify array keys and reference functions in phpdoc (format).
  • Infer argument types inside closures from array_map, array_filter, etc...
  • And much more sweet things...
This plugin greatly extends phpstorm's typing with associative array support

---------------------------------


Completion from function called in a function called in another function...

---------------------------------


Specify type with key names and data source functions in PHP DOC

---------------------------------


Infer type inside chained method calls and wrappers

---------------------------------


Infer argument type based on function usage

---------------------------------


Infer type from \PDO or mysqli queries if DB is connected

Recent change notes

  • #63 Allow to use self:: and $this-> in @method/@property phpdocs
  • #66 Fix: do not suggest class constants as static fields
  • Optimize: use It.frs() instead of It.has(). Since It.has() caused iteration over first value on every iterator which resulted in Laravel project completion being suggested only after 4 seconds (now first option appears after 200 ms)

General usage instructions

Press Ctrl+Space when caret is inside quotes to get completion options for associative array keys. The plugin will analyze your code to gather info about the variable.
Put caret on the accessed key and press Ctrl+B (or Ctrl+Left Mouse Button) to go to the definition.