Skip to content

Commit

Permalink
breaking fixes: leave only enum class
Browse files Browse the repository at this point in the history
  • Loading branch information
lonesski committed Dec 11, 2020
1 parent 293bb82 commit 3541bf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 103 deletions.
101 changes: 0 additions & 101 deletions src/CastStringEnums.php

This file was deleted.

7 changes: 5 additions & 2 deletions src/StringEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ public function toArray()
return $this->key;
}

public function __toString(): string
public static function parseDatabase($value)
{
return $this->key;
if (self::hasKey($value)) {
return self::fromKey($value)->value;
}
return parent::parseDatabase($value);
}
}

0 comments on commit 3541bf3

Please sign in to comment.