TWeak meta methods

This commit is contained in:
Barry vd. Heuvel
2015-03-16 14:14:57 +01:00
parent d922d7e7ce
commit b6a5262f3b
2 changed files with 28 additions and 21 deletions
+16 -20
View File
@@ -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 ?>
];
}
+12 -1
View File
@@ -41,6 +41,12 @@ class MetaCommand extends Command {
/** @var \Illuminate\View\Factory */
protected $view;
protected $methods = [
'\Illuminate\Foundation\Application::make',
'\App::make',
'app'
];
/**
*
* @param \Illuminate\Filesystem\Filesystem $files
@@ -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) {