mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
TWeak meta methods
This commit is contained in:
+16
-20
@@ -1,24 +1,20 @@
|
||||
<?= '<?php' ?> namespace PHPSTORM_META {
|
||||
|
||||
/**
|
||||
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
|
||||
* Generated on <?= date("Y-m-d") ?>.
|
||||
*
|
||||
* @author Barry vd. Heuvel <[email protected]>
|
||||
* @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 <?= date("Y-m-d") ?>.
|
||||
*
|
||||
* @author Barry vd. Heuvel <[email protected]>
|
||||
* @see https://github.com/barryvdh/laravel-ide-helper
|
||||
* @noinspection PhpUnusedLocalVariableInspection
|
||||
* @noinspection PhpIllegalArrayKeyTypeInspection
|
||||
*/
|
||||
$STATIC_METHOD_TYPES = [
|
||||
<?php foreach($methods as $method): ?>
|
||||
<?= $method ?>('') => [
|
||||
<?php foreach($bindings as $abstract => $class): ?>
|
||||
'<?= $abstract ?>' instanceof \<?= $class ?>,
|
||||
<?php endforeach ?> ],
|
||||
app('') => [
|
||||
<?php foreach($bindings as $abstract => $class): ?>
|
||||
'<?= $abstract ?>' instanceof \<?= $class ?>,
|
||||
<?php endforeach ?> ],
|
||||
];
|
||||
|
||||
'<?= $abstract ?>' instanceof \<?= $class ?>,
|
||||
<?php endforeach ?> ],
|
||||
<?php endforeach ?>
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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('ide-helper::meta', ['bindings' => $bindings])->render();
|
||||
|
||||
$content = $this->view->make('ide-helper::meta', [
|
||||
'bindings' => $bindings,
|
||||
'methods' => $this->methods,
|
||||
])->render();
|
||||
|
||||
$written = $this->files->put($filename, $content);
|
||||
|
||||
if ($written !== false) {
|
||||
|
||||
Reference in New Issue
Block a user