mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Add support for custom cast classes (#816)
* Add support for custom cast classes * Fix unrelated code style warning.
This commit is contained in:
committed by
Barry vd. Heuvel
parent
7b4cef1ea4
commit
3668e3821a
@@ -290,7 +290,7 @@ class ModelsCommand extends Command
|
|||||||
$realType = '\Illuminate\Support\Collection';
|
$realType = '\Illuminate\Support\Collection';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$realType = 'mixed';
|
$realType = class_exists($type) ? ('\\' . $type) : 'mixed';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,7 +456,7 @@ class ModelsCommand extends Command
|
|||||||
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
|
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
|
||||||
$reflection = new \ReflectionMethod($model, $method);
|
$reflection = new \ReflectionMethod($model, $method);
|
||||||
// php 7.x type or fallback to docblock
|
// php 7.x type or fallback to docblock
|
||||||
$type = (string) $reflection->getReturnType() ?: (string)$this->getReturnTypeFromDocBlock($reflection);
|
$type = (string)($reflection->getReturnType() ?: $this->getReturnTypeFromDocBlock($reflection));
|
||||||
|
|
||||||
$file = new \SplFileObject($reflection->getFileName());
|
$file = new \SplFileObject($reflection->getFileName());
|
||||||
$file->seek($reflection->getStartLine() - 1);
|
$file->seek($reflection->getStartLine() - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user