mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +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()) {
|
||||
|
||||
@@ -81,7 +81,7 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple[] $relationMorphMany
|
||||
* @property-read int|null $relation_morph_many_count
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple $relationMorphOne
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple $relationMorphTo
|
||||
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $relationMorphTo
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple[] $relationMorphedByMany
|
||||
* @property-read int|null $relation_morphed_by_many_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple newModelQuery()
|
||||
|
||||
Reference in New Issue
Block a user