Skip to content

Commit 0f00ab7

Browse files
committed
Fix phpcs;
1 parent a1d8927 commit 0f00ab7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Relations/MorphTo.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ public function addConstraints()
1616
// For belongs to relationships, which are essentially the inverse of has one
1717
// or has many relationships, we need to actually query on the primary key
1818
// of the related models matching on the foreign key that's on a parent.
19-
$this->query->where($this->ownerKey ?: $this->query->getModel()->getKeyName(), '=',
20-
$this->parent->{$this->foreignKey});
19+
$this->query->where(
20+
$this->ownerKey ?: $this->query->getModel()->getKeyName(),
21+
'=',
22+
$this->parent->{$this->foreignKey},
23+
);
2124
}
2225
}
2326

tests/RelationsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ public function testMorph(): void
481481
$this->assertEquals($client->_id, $photo->hasImage->_id);
482482

483483
// inverse with custom ownerKey
484-
$photo = Photo::query()->create([ 'url' => 'https://graph.facebook.com/young.gerald/picture']);
485-
$client = Client::create(['cclient_id' => (string) (new ObjectId()),'name' => 'Young Gerald']);
484+
$photo = Photo::query()->create(['url' => 'https://graph.facebook.com/young.gerald/picture']);
485+
$client = Client::create(['cclient_id' => (string) (new ObjectId()), 'name' => 'Young Gerald']);
486486
$photo->hasImageWithCustomOwnerKey()->associate($client)->save();
487487

488488
$this->assertCount(1, $photo->hasImageWithCustomOwnerKey()->get());

0 commit comments

Comments
 (0)