mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 02:23:11 +00:00
Move back to original phpdocumentor/reflection-docblock
Because it is stable now.
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
"illuminate/support": "4.x",
|
"illuminate/support": "4.x",
|
||||||
"illuminate/console": "4.x",
|
"illuminate/console": "4.x",
|
||||||
"illuminate/filesystem": "4.x",
|
"illuminate/filesystem": "4.x",
|
||||||
"barryvdh/reflection-docblock": ">=2.0.1",
|
"phpdocumentor/reflection-docblock": "2.0.0",
|
||||||
"symfony/class-loader": "~2.3"
|
"symfony/class-loader": "~2.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ use Illuminate\Console\Command;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Illuminate\Foundation\AliasLoader;
|
use Illuminate\Foundation\AliasLoader;
|
||||||
use Barryvdh\Reflection\DocBlock;
|
use phpDocumentor\Reflection\DocBlock;
|
||||||
use Barryvdh\Reflection\DocBlock\Context;
|
use phpDocumentor\Reflection\DocBlock\Context;
|
||||||
use Barryvdh\Reflection\DocBlock\Tag;
|
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
||||||
/**
|
/**
|
||||||
* A command to generate autocomplete information for your IDE
|
* 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);
|
$this->normalizeDescription($phpdoc, $method);
|
||||||
|
|
||||||
//Correct the return values
|
//Correct the return values
|
||||||
$returnValue = $this->normalizeReturn($phpdoc, $method, $alias);
|
$returnValue = $this->getReturn($phpdoc);
|
||||||
|
|
||||||
//Get the parameters, including formatted default values
|
//Get the parameters, including formatted default values
|
||||||
list($params, $paramsWithDefault) = $this->getParameters($method);
|
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.
|
* Make some changes to the return types, if needed.
|
||||||
*
|
*
|
||||||
* @param $phpdoc
|
* @param $phpdoc
|
||||||
* @param $method
|
* @return string|null
|
||||||
* @param $alias
|
|
||||||
* @return null
|
|
||||||
*/
|
*/
|
||||||
protected function normalizeReturn(&$phpdoc, $method, $alias){
|
protected function getReturn($phpdoc){
|
||||||
//Get the return type and adjust them for beter autocomplete
|
//Get the return type and adjust them for beter autocomplete
|
||||||
$returnTags = $phpdoc->getTagsByName('return');
|
$returnTags = $phpdoc->getTagsByName('return');
|
||||||
if($returnTags){
|
if($returnTags){
|
||||||
/** @var $tag */
|
/** @var $tag */
|
||||||
$tag = reset($returnTags);
|
$tag = reset($returnTags);
|
||||||
$returnValue = $tag->getType();
|
$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{
|
}else{
|
||||||
$returnValue = null;
|
$returnValue = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user