mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Use return $this for some Eloquent
So autocomplete uses the real model, not just the base Model. (Doesn't seem to work on Sublime)
This commit is contained in:
@@ -222,7 +222,11 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n";
|
||||
$output .="\t * @param\t".implode($annotation->values, "\t")."\n";
|
||||
}
|
||||
}
|
||||
if($returnValue !== "void"){
|
||||
if(!$sublime && $root == 'Illuminate\Database\Eloquent\Model' &&
|
||||
in_array($method->name, array('fill', 'newInstance', 'newFromBuilder', 'create', 'find', 'findOrFail'))){
|
||||
//Reference the calling class, to provide more accurate auto-complete
|
||||
$output .= "\t * @return \$this\n";
|
||||
}else{
|
||||
$output .= "\t * @return ".$returnValue."\n";
|
||||
}
|
||||
$output .= "\t */\n\t public static function ".$method->name."(";
|
||||
|
||||
Reference in New Issue
Block a user