mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-20 02:53:11 +00:00
Refactor a bit
This commit is contained in:
@@ -238,7 +238,7 @@ class ModelsCommand extends Command {
|
|||||||
$args = $this->getParameters($reflection);
|
$args = $this->getParameters($reflection);
|
||||||
//Remove the first ($query) argument
|
//Remove the first ($query) argument
|
||||||
array_shift($args);
|
array_shift($args);
|
||||||
$this->setMethod($name, "static " . $reflection->class, $args);
|
$this->setMethod($name, $reflection->class, $args);
|
||||||
}
|
}
|
||||||
}elseif(!method_exists('Eloquent', $method) && !\Str::startsWith($method, 'get')){
|
}elseif(!method_exists('Eloquent', $method) && !\Str::startsWith($method, 'get')){
|
||||||
|
|
||||||
@@ -304,13 +304,9 @@ class ModelsCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setMethod($name, $type = null, $arguments=array()){
|
protected function setMethod($name, $type = '', $arguments=array()){
|
||||||
if(!isset($this->methods[$name])){
|
if(!isset($this->methods[$name])){
|
||||||
$this->methods[$name] = array();
|
$this->methods[$name] = array();
|
||||||
$this->methods[$name]['type'] = 'static';
|
|
||||||
$this->methods[$name]['arguments'] = $arguments;
|
|
||||||
}
|
|
||||||
if($type !== null){
|
|
||||||
$this->methods[$name]['type'] = $type;
|
$this->methods[$name]['type'] = $type;
|
||||||
$this->methods[$name]['arguments'] = $arguments;
|
$this->methods[$name]['arguments'] = $arguments;
|
||||||
}
|
}
|
||||||
@@ -369,7 +365,7 @@ class ModelsCommand extends Command {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$arguments = implode(', ',$method['arguments']);
|
$arguments = implode(', ',$method['arguments']);
|
||||||
$tag = Tag::createInstance("@method {$method['type']} {$name}({$arguments}) ", $phpdoc);
|
$tag = Tag::createInstance("@method static {$method['type']} {$name}({$arguments}) ", $phpdoc);
|
||||||
$phpdoc->appendTag($tag);
|
$phpdoc->appendTag($tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user