Skip to content

Commit

Permalink
[rector] Rector fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Sep 22, 2023
1 parent 621a44a commit 37f3926
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Fields/Relationships/MorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function requestTypeValue(): string

public function getTypes(): array
{
if(empty($this->types)) {
if($this->types === []) {
throw new FieldException('Morph types is required');
}

Expand All @@ -108,7 +108,7 @@ public function values(): array

if(is_null($this->formattedValueCallback())) {
$this->setFormattedValueCallback(
fn($v) => $v->{$this->getSearchColumn(get_class($v))}
fn($v) => $v->{$this->getSearchColumn($v::class)}
);
}

Expand All @@ -132,7 +132,7 @@ protected function resolvePreview(): string
->append(
$item
->{$this->getRelationName()}
->{$this->getSearchColumn(get_class($item->{$this->getRelationName()}))}
->{$this->getSearchColumn($item->{$this->getRelationName()}::class)}
)
->append(')')
->value();
Expand Down

0 comments on commit 37f3926

Please sign in to comment.