Skip to content

Commit ea8ba3a

Browse files
committed
fix enums
1 parent 0810d2e commit ea8ba3a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Model/Model.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public function &__get(string $key): mixed //phpcs:ignore
5252
if ($returnType->isSubclassOf(self::class)) {
5353
$value = $returnType->newInstance($value->toArray(), $value->getTable());
5454
}
55-
}/* elseif ($returnType->isSubclassOf(\BackedEnum::class)) {
55+
} elseif ($returnType->isSubclassOf(\BackedEnum::class)) {
5656
$value = $returnType->getMethod('tryFrom')->invoke($returnType, $value);
57-
}*/
57+
}
5858
}
5959
}
6060
return $value;
@@ -96,10 +96,7 @@ public function getReferencedModel(string $requestedModel): ?self
9696
throw new CannotAccessModelException($requestedModel, $this);
9797
}
9898

99-
/**
100-
* @return static
101-
*/
102-
public static function createFromActiveRow(ActiveRow $row): self
99+
public static function createFromActiveRow(ActiveRow $row): static
103100
{
104101
if ($row instanceof static) {
105102
return $row;

0 commit comments

Comments
 (0)