mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Tweak helper behavior
Helper file not included by default, but can be enabled with the config file. Default value can be overridden with the --helpers (-H) of --nohelpers (-N) options.
This commit is contained in:
@@ -31,7 +31,13 @@ class GeneratorCommand extends Command {
|
||||
$filename = $this->argument('filename');
|
||||
|
||||
$aliases = \Config::get('laravel-ide-helper::aliases');
|
||||
$helpers = \Config::get('laravel-ide-helper::helpers');
|
||||
|
||||
if( $this->option('helpers') || (\Config::get('laravel-ide-helper::include_helpers') && ! $this->option('nohelpers'))){
|
||||
$helpers = \Config::get('laravel-ide-helper::helper_files');
|
||||
}else{
|
||||
$helpers = array();
|
||||
}
|
||||
|
||||
$content = $this->generateDocs($aliases, $helpers);
|
||||
|
||||
$written = \File::put($filename, $content);
|
||||
@@ -56,6 +62,19 @@ class GeneratorCommand extends Command {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return array(
|
||||
array('helpers', "H", InputOption::VALUE_NONE, 'Include the helper files'),
|
||||
array('nohelpers', "N", InputOption::VALUE_NONE, 'Do not include the helper files'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function generateDocs($aliases, $helpers){
|
||||
$d = new Parser();
|
||||
$d->setAllowInherited(true);
|
||||
|
||||
Reference in New Issue
Block a user