Fix Bug PHP 7.3 & L5.8 (#774)

add cast (string) to disable bug ($type can be null)
This commit is contained in:
neoteknic
2019-03-02 15:14:46 +01:00
committed by Barry vd. Heuvel
parent 754bb4d075
commit 0fad511954
+1 -1
View File
@@ -480,7 +480,7 @@ class ModelsCommand extends Command
'morphedByMany' => '\Illuminate\Database\Eloquent\Relations\MorphToMany'
) as $relation => $impl) {
$search = '$this->' . $relation . '(';
if (stripos($code, $search) || stripos($impl, $type) !== false) {
if (stripos($code, $search) || stripos($impl, (string)$type) !== false) {
//Resolve the relation's model to a Relation object.
$methodReflection = new \ReflectionMethod($model, $method);
if ($methodReflection->getNumberOfParameters()) {