From d1e396f658db823c6891c8f65692ca9751dbd1e8 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Thu, 8 Aug 2013 17:58:31 +0200 Subject: [PATCH] Move back to original phpdocumentor/reflection-docblock Because it is stable now. --- composer.json | 2 +- .../LaravelIdeHelper/GeneratorCommand.php | 22 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index bf957b1..d3c8998 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "illuminate/support": "4.x", "illuminate/console": "4.x", "illuminate/filesystem": "4.x", - "barryvdh/reflection-docblock": ">=2.0.1", + "phpdocumentor/reflection-docblock": "2.0.0", "symfony/class-loader": "~2.3" }, "autoload": { diff --git a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php index 8851be3..3a8d8b8 100755 --- a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php +++ b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php @@ -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 Barryvdh\Reflection\DocBlock; -use Barryvdh\Reflection\DocBlock\Context; -use Barryvdh\Reflection\DocBlock\Tag; -use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; +use phpDocumentor\Reflection\DocBlock; +use phpDocumentor\Reflection\DocBlock\Context; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer; /** * A command to generate autocomplete information for your IDE * @@ -304,7 +304,7 @@ exit('Only to be used as an helper for your IDE');\n\n"; $this->normalizeDescription($phpdoc, $method); //Correct the return values - $returnValue = $this->normalizeReturn($phpdoc, $method, $alias); + $returnValue = $this->getReturn($phpdoc); //Get the parameters, including formatted default values list($params, $paramsWithDefault) = $this->getParameters($method); @@ -371,23 +371,15 @@ exit('Only to be used as an helper for your IDE');\n\n"; * Make some changes to the return types, if needed. * * @param $phpdoc - * @param $method - * @param $alias - * @return null + * @return string|null */ - protected function normalizeReturn(&$phpdoc, $method, $alias){ + protected function getReturn($phpdoc){ //Get the return type and adjust them for beter autocomplete $returnTags = $phpdoc->getTagsByName('return'); if($returnTags){ /** @var $tag */ $tag = reset($returnTags); $returnValue = $tag->getType(); - - if($method->name == "__construct"){ - $tag->setType('self'); - }elseif($alias == 'Eloquent' and in_array($method->name, array('hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'morphOne', 'morphTo', 'morphMany'))){ - $tag->addType('\Eloquent'); - } }else{ $returnValue = null; }