mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Fixed bug in model command where loose string comparison would override properties for model relations (#873)
This commit is contained in:
committed by
Barry vd. Heuvel
parent
6af1f32d96
commit
e020e265a4
@@ -505,7 +505,7 @@ class ModelsCommand extends Command
|
||||
'morphedByMany' => '\Illuminate\Database\Eloquent\Relations\MorphToMany'
|
||||
) as $relation => $impl) {
|
||||
$search = '$this->' . $relation . '(';
|
||||
if (stripos($code, $search) || stripos($impl, (string)$type) !== false) {
|
||||
if (stripos($code, $search) || $impl === (string)$type) {
|
||||
//Resolve the relation's model to a Relation object.
|
||||
$methodReflection = new \ReflectionMethod($model, $method);
|
||||
if ($methodReflection->getNumberOfParameters()) {
|
||||
|
||||
Reference in New Issue
Block a user