mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 10:33:11 +00:00
Add namespace DocBlock context
So they can be expanded correctly
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
use Illuminate\Console\Command;
|
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 DocBlock\Parser;
|
|
||||||
use Illuminate\Foundation\AliasLoader;
|
use Illuminate\Foundation\AliasLoader;
|
||||||
use phpDocumentor\Reflection\DocBlock;
|
use phpDocumentor\Reflection\DocBlock;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Context;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tag;
|
use phpDocumentor\Reflection\DocBlock\Tag;
|
||||||
use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
use phpDocumentor\Reflection\DocBlock\Serializer as DocBlockSerializer;
|
||||||
/**
|
/**
|
||||||
@@ -250,7 +250,15 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpdoc = new DocBlock($method);
|
if(strpos($root, '\\') !== false){
|
||||||
|
$parts = explode('\\', $root);
|
||||||
|
$lsen = array_pop($parts);
|
||||||
|
$namespace = implode($parts, '\\');
|
||||||
|
}else{
|
||||||
|
$namespace = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpdoc = new DocBlock($method, new Context($namespace));
|
||||||
$serializer = new DocBlockSerializer("\t", 1);
|
$serializer = new DocBlockSerializer("\t", 1);
|
||||||
|
|
||||||
$description = $phpdoc->getText();
|
$description = $phpdoc->getText();
|
||||||
@@ -273,7 +281,6 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
|
|||||||
|
|
||||||
$phpdoc->appendTag(Tag::createInstance('@static', $phpdoc));
|
$phpdoc->appendTag(Tag::createInstance('@static', $phpdoc));
|
||||||
|
|
||||||
|
|
||||||
$returnTags = $phpdoc->getTagsByName('return');
|
$returnTags = $phpdoc->getTagsByName('return');
|
||||||
if($returnTags){
|
if($returnTags){
|
||||||
/** @var $tag */
|
/** @var $tag */
|
||||||
@@ -286,7 +293,7 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
|
|||||||
//Reference the calling class, to provide more accurate auto-complete
|
//Reference the calling class, to provide more accurate auto-complete
|
||||||
$returnValue = "static";
|
$returnValue = "static";
|
||||||
}elseif(!$sublime and $alias == 'Eloquent' and in_array($method->name, array('all', 'get'))){
|
}elseif(!$sublime and $alias == 'Eloquent' and in_array($method->name, array('all', 'get'))){
|
||||||
$returnValue .= "|Eloquent[]|static[]";
|
$returnValue .= "|\Eloquent[]|static[]";
|
||||||
}
|
}
|
||||||
$tag->setContent($returnValue . " ". $tag->getDescription());
|
$tag->setContent($returnValue . " ". $tag->getDescription());
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user