mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-19 09:08:45 +02:00
Use enum for manufacturing status
This commit is contained in:
parent
6336b38cfc
commit
9e3cb4d694
7 changed files with 88 additions and 30 deletions
|
@ -31,10 +31,14 @@ class EnumColumn extends AbstractColumn
|
|||
{
|
||||
|
||||
/**
|
||||
* @phpstan-return T
|
||||
* @phpstan-return T|null
|
||||
*/
|
||||
public function normalize($value): UnitEnum
|
||||
public function normalize($value): ?UnitEnum
|
||||
{
|
||||
if ($value === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (is_a($value, $this->getEnumClass())) {
|
||||
return $value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue