mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
Check if returnType from docblock is not null
This commit is contained in:
@@ -821,7 +821,9 @@ class ModelsCommand extends Command
|
||||
) {
|
||||
$matches = [];
|
||||
$returnType = $this->getReturnTypeFromDocBlock($reflection);
|
||||
preg_match('/MorphTo<(.+?)(?:,|>)/i', $returnType, $matches);
|
||||
if ($returnType !== null) {
|
||||
preg_match('/MorphTo<(.+?)(?:,|>)/i', $returnType, $matches);
|
||||
}
|
||||
|
||||
// Model isn't specified because relation is polymorphic
|
||||
$this->setProperty(
|
||||
|
||||
Reference in New Issue
Block a user