Skip to content

Commit

Permalink
fix enums
Browse files Browse the repository at this point in the history
  • Loading branch information
cevro committed Nov 2, 2024
1 parent 0810d2e commit ea8ba3a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function &__get(string $key): mixed //phpcs:ignore
if ($returnType->isSubclassOf(self::class)) {
$value = $returnType->newInstance($value->toArray(), $value->getTable());
}
}/* elseif ($returnType->isSubclassOf(\BackedEnum::class)) {
} elseif ($returnType->isSubclassOf(\BackedEnum::class)) {
$value = $returnType->getMethod('tryFrom')->invoke($returnType, $value);
}*/
}
}
}
return $value;
Expand Down Expand Up @@ -96,10 +96,7 @@ public function getReferencedModel(string $requestedModel): ?self
throw new CannotAccessModelException($requestedModel, $this);
}

/**
* @return static
*/
public static function createFromActiveRow(ActiveRow $row): self
public static function createFromActiveRow(ActiveRow $row): static
{
if ($row instanceof static) {
return $row;
Expand Down

0 comments on commit ea8ba3a

Please sign in to comment.