From 6ed5367f6b2b57bde57968f936f5cefc37db5ce2 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 16 Mar 2015 14:16:41 +0100 Subject: [PATCH] Tweak meta methods --- src/Console/MetaCommand.php | 13 ++++++++++++- src/views/meta.php | 36 ++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/Console/MetaCommand.php b/src/Console/MetaCommand.php index b9d0753..7979826 100644 --- a/src/Console/MetaCommand.php +++ b/src/Console/MetaCommand.php @@ -40,6 +40,12 @@ class MetaCommand extends Command { /** @var \Illuminate\View\Factory */ protected $view; + + protected $methods = [ + '\Illuminate\Foundation\Application::make', + '\App::make', + 'app' + ]; /** * @@ -73,7 +79,12 @@ class MetaCommand extends Command { $this->error("Cannot make $abstract: ".$e->getMessage()); } } - $content = $this->view->make('laravel-ide-helper::meta', ['bindings' => $bindings])->render(); + + $content = $this->view->make('laravel-ide-helper::meta', [ + 'bindings' => $bindings, + 'methods' => $this->methods, + ])->render(); + $written = $this->files->put($filename, $content); if ($written !== false) { diff --git a/src/views/meta.php b/src/views/meta.php index eeed9dd..514b923 100644 --- a/src/views/meta.php +++ b/src/views/meta.php @@ -1,24 +1,20 @@ namespace PHPSTORM_META { -/** - * PhpStorm Meta file, to provide autocomplete information for PhpStorm - * Generated on . - * - * @author Barry vd. Heuvel - * @see https://github.com/barryvdh/laravel-ide-helper - */ - -/** @noinspection PhpUnusedLocalVariableInspection */ -/** @noinspection PhpIllegalArrayKeyTypeInspection */ -$STATIC_METHOD_TYPES = [ - \App::make('') => [ + /** + * PhpStorm Meta file, to provide autocomplete information for PhpStorm + * Generated on . + * + * @author Barry vd. Heuvel + * @see https://github.com/barryvdh/laravel-ide-helper + * @noinspection PhpUnusedLocalVariableInspection + * @noinspection PhpIllegalArrayKeyTypeInspection + */ + $STATIC_METHOD_TYPES = [ + + ('') => [ $class): ?> - '' instanceof \, - ], - app('') => [ - $class): ?> - '' instanceof \, - ], -]; - + '' instanceof \, + ], + + ]; }