Skip to content

Commit

Permalink
better validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Feb 13, 2022
1 parent b2b0795 commit c3d2492
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/enums/LitColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class LitColor {
public static array $values = [ "green", "purple", "white", "red", "pink" ];

public static function isValid( string $value ) {
if( strpos($value, ',') ) {
return areValid( explode(',', $value) );
}
return in_array( $value, self::$values );
}

Expand Down

0 comments on commit c3d2492

Please sign in to comment.