deep-assoc-completion

Compatible with: IntelliJ IDEA PhpStorm
Dec 12, 2018
17 995
  • PHP associative array auto-completion inferred from other functions (in other files).
  • Go To key Definition.
  • Specify array keys and reference functions in phpdoc.
  • Infer argument types inside closures from array_map, array_filter, etc...
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 SQL-s if DB is connected

Download plugin

Recent change notes

  • Enable brief value preview back, freezes issue was solved by recursion detection
  • Fix: Go To the original string literal, not to a var in which it was stored
  • Optimize: Recursion detection in expression chain is back. Tests run 2 times faster, yay
  • Optimize: Return iterator in array_combine resolution instead of resolving full type at once
  • Optimize: Do not iterate over _all_ results to just get the reduced IDEA type at once - return iterator instead
  • 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.