News for hackers. Stuff that matters.
Re:Phan by Etsy – A Static Analyzer for PHP 7+ by cweagans on Tuesday December 08, 2015 @10:26AM (#10696862)
This is awesome. Any plans to add autocomplete functionality similar to HHVM's typechecker?
Re:Phan by Etsy – A Static Analyzer for PHP 7+ by asm on Tuesday December 08, 2015 @10:30AM (#10696898)
We'd like to get there eventually. Phan populates a sqlite database when analyzing code (if run with the -s flag). This allows fast runs on single file changes or patches. We're hoping to use this for things like auto-complete and finding callers for a class/method/whatever eventually.

For now, we have a primordial Syntastic vim plugin (https://github.com/etsy/phan/blob/master/plugins/vim/bundle/...) for getting errors into the quickfix view.

Re:Phan by Etsy – A Static Analyzer for PHP 7+ by cweagans on Tuesday December 08, 2015 @10:35AM (#10696934)
That's awesome. If a PR was opened that added autocomplete and/or finding callers and/or refactoring (and assuming that the code is good), would you guys be open to merging it? Or would it be delayed so that the core functionality can be focused on?
Re:Phan by Etsy – A Static Analyzer for PHP 7+ by asm on Tuesday December 08, 2015 @10:41AM (#10696981)
Definitely.

If you want to start working on that, feel free to open up an issue (https://github.com/etsy/phan/issues/new) to start a conversation about it.

We currently store method/function callers in the sqlite database (see https://github.com/etsy/phan/blob/master/src/Phan/Analyze/Br...), but aren't yet exposing an interface for getting callers. We'll want to store callers for constants, classes, properties and global variables as well.

Re:Phan by Etsy – A Static Analyzer for PHP 7+ by allan_s on Tuesday December 08, 2015 @03:59PM (#10699463)
Meanwhile, have you checked padawan ? https://github.com/mkusher/padawan.php it's a server made to be used by editors for autocompletion of PHP code (like jedi for python) it works pretty well with vim AFAIK
Re:Phan by Etsy – A Static Analyzer for PHP 7+ by cweagans on Tuesday December 08, 2015 @11:30PM (#10701910)
Yep. https://github.com/mkusher/padawan.php/issues/1

Project started after mine. https://github.com/cweagans/theforce

Just ran out of time, so mkusher did his own thing. I disagree with his direction and I think it's overly complex from a user's standpoint, but he disagrees and isn't willing to change it, so I lost interest in that project too.

Using the actual AST from the PHP interpreter is going to be a) much faster and b) much more accurate.