mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +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";
|
$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 * @return ".$returnValue."\n";
|
||||||
}
|
}
|
||||||
$output .= "\t */\n\t public static function ".$method->name."(";
|
$output .= "\t */\n\t public static function ".$method->name."(";
|
||||||
|
|||||||
Reference in New Issue
Block a user