laravel4-phpstorm-helper icon indicating copy to clipboard operation
laravel4-phpstorm-helper copied to clipboard

Cleaned up and edited with latest L4 revisions

Open jonphipps opened this issue 12 years ago • 7 comments

Latest Laravel 4 as of 02/20/2013, edited to include the defaults missed by the codeintel parser, along with some other minor flaws in the output. Based strictly on the json config file supplied with the parser.

jonphipps avatar Feb 22 '13 19:02 jonphipps

This works well. Should be merged

andrew13 avatar Feb 22 '13 20:02 andrew13

+1 working perfectly in PhpED too

lukefor avatar Feb 24 '13 19:02 lukefor

This also fixes issue #2

jonphipps avatar Feb 26 '13 11:02 jonphipps

Not for me. Look at: https://dl.dropbox.com/u/871494/phps-laravel.jpg There is a lot of errors/warnings: Non-static method 'get' should not be called statically or 'void' method 'to' result used, etc.

kwolniak avatar Feb 26 '13 16:02 kwolniak

@kwolniak Your first issue with "Non-static method 'get' should not be called statically" warning is a side-effect of re-declaring the methods statically and I don't think that can be avoided with the current version (or 6) of PHPstorm. The " 'void' method 'to' result used" warning is the result of the Laravel 4 docblocks defaulting to @return void regardless of what is returned and rarely correcting it. There are many things wrong with the docblocks, and there's an open PR from @ROMOPAT that fixes some. But I suspect that it's both a low priority, given the fact that it's apparently not an issue for Sublime and probably no longer mergeable: https://github.com/laravel/framework/pull/72

I ended up changing the severity of the checks for those in PHPstorm to a 'weak warning', although you can turn the check off entirely:

  • Preferences::Inspections::General::Dynamic method called as static
  • Preferences::Inspections::Probably Bug::Void function result used

Last, but hardly least Laravel 4 is a very moving target with classes coming, going, and being moved around. Much has changed in the last month. Running the codeintel script weekly seems to result in quite a few changes. There's also the issue of being able to properly reflect the methods returned by a serviceprovider that provides static version of methods from several classes, like Validator does. I think that some refactoring of the codeintel script to support merging several classes into a single service provider would be useful: https://github.com/laravelbook/laravel-codeintel-generator/issues/3

Of the many L4 ide helpers, this is the only one that I know of that's being built by a code parser, and that means that there's at least a hope of keeping up with the changes. Until these issues are either resolved by the IDE makers or L4 stabilizes enough to make building this by hand worthwhile, this represents the best solution of found.

jonphipps avatar Feb 27 '13 15:02 jonphipps

You could also take a look at my helper generator: https://github.com/barryvdh/laravel-ide-helper This doesn't have static warnings or missing (default) arguments, and is generated dynamically, so you can update it yourself. (With artisan instead of python)

barryvdh avatar Mar 21 '13 11:03 barryvdh

Barry. Really nice, best fix so far for me!

MLenngren avatar Apr 03 '13 16:04 MLenngren