mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Add support for factory()->create() return types (#758)
* Revert "Forked release" * Initial factory builder support * Oops — fixed tabs * Revert "Forked release" * Whitespace * Reverted more code * Whitespace * More whitespace * Fixed PHPCS line
This commit is contained in:
committed by
Barry vd. Heuvel
parent
25b61c56fe
commit
6c8e847430
@@ -457,7 +457,9 @@ class ModelsCommand extends Command
|
||||
$reflection = new \ReflectionMethod($model, $method);
|
||||
|
||||
if ($returnType = $reflection->getReturnType()) {
|
||||
$type = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string)$returnType;
|
||||
$type = $returnType instanceof \ReflectionNamedType
|
||||
? $returnType->getName()
|
||||
: (string)$returnType;
|
||||
} else {
|
||||
// php 7.x type or fallback to docblock
|
||||
$type = (string)$this->getReturnTypeFromDocBlock($reflection);
|
||||
|
||||
Reference in New Issue
Block a user