Compare commits

...
3 Commits
Author SHA1 Message Date
Barry vd. Heuvel c4de6e80c9 Remove nohelpers option 2013-06-18 15:45:10 +02:00
Barry vd. Heuvel 6f03c4c5ff Move some logic to ReflectionDocblock 2013-06-09 14:17:24 +02:00
Barry vd. Heuvel 8db4443879 Use fork of ReflectionDocblock
So I can use a stable version.. Fixes #21
2013-06-08 13:02:28 +02:00
3 changed files with 15 additions and 29 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x",
"illuminate/filesystem": "4.0.x",
"phpdocumentor/reflection-docblock": "dev-master#6d705c1a0f9e2a6d73d2e9ec0e538b9dfaf4315f",
"barryvdh/reflection-docblock": ">=2.0.1",
"symfony/class-loader": "2.3.*"
},
"autoload": {
@@ -13,10 +13,10 @@ use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Illuminate\Foundation\AliasLoader;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Context;
use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer;
use Barryvdh\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock\Context;
use Barryvdh\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
/**
* A command to generate autocomplete information for your IDE
*
@@ -64,7 +64,7 @@ class GeneratorCommand extends Command {
$this->nonstatic = \Config::get('laravel-ide-helper::nonstatic');
$this->onlyExtend = \Config::get('laravel-ide-helper::only_extend');
if( $this->option('helpers') || (\Config::get('laravel-ide-helper::include_helpers') && ! $this->option('nohelpers'))){
if( $this->option('helpers') || (\Config::get('laravel-ide-helper::include_helpers') )){
$this->helpers = \Config::get('laravel-ide-helper::helper_files');
}else{
$this->helpers = array();
@@ -305,20 +305,6 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
//Make the method static
$phpdoc->appendTag(Tag::createInstance('@static', $phpdoc));
//Looping through the parameters and re-setting the type, to get the expanded type (with namespace)
//Should be fixed in a future version of ReflectionDocBlock I hope..
$paramTags = $phpdoc->getTagsByName('param');
if($paramTags){
/** @var $tag */
foreach($paramTags as $tag){
$content = $tag->getContent();
//Closure should be \Closure..
$content = str_replace('\Closure', 'Closure', $content);
$content = str_replace('Closure', '\Closure', $content);
$tag->setContent($content);
$tag->setContent($tag->getType() . ' ' . $tag->getVariableName() . ' ' . $tag->getDescription());
}
}
//Get the return type and adjust them for beter autocomplete
$returnTags = $phpdoc->getTagsByName('return');
@@ -328,18 +314,18 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
$returnValue = $tag->getType();
if($method->name == "__construct"){
$returnValue = 'self';
$tag->setType('self');
}elseif($alias == 'Eloquent' and
(in_array($method->name, array('pluck', 'first', 'fill', 'newInstance', 'newFromBuilder', 'create', 'find', 'findOrFail'))
or $returnValue === '\Illuminate\Database\Query\Builder')){
//Reference the calling class, to provide more accurate auto-complete
$returnValue .= "static";
$tag->addType('static');
}elseif($alias == 'Eloquent' and in_array($method->name, array('all', 'get'))){
$returnValue .= "|\Eloquent[]|static[]";
$tag->addType('\Eloquent[]');
$tag->addType('static[]');
}elseif($alias == 'Eloquent' and in_array($method->name, array('hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'morphOne', 'morphTo', 'morphMany'))){
$returnValue .= "|\Eloquent";
$tag->addType('\Eloquent');
}
$tag->setContent($returnValue . " ". $tag->getDescription());
}else{
$returnValue = null;
}
@@ -13,10 +13,10 @@ use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\ClassLoader\ClassMapGenerator;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Context;
use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer;
use Barryvdh\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock\Context;
use Barryvdh\Reflection\DocBlock\Tag;
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
/**
* A command to generate autocomplete information for your IDE
*