Last active
October 20, 2019 09:12
-
-
Save cspray/d5bbd816ef315e5564f1c2b3e8fa45fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace YourNamespace\Enums; | |
use Cspray\Yape\Enum; | |
use Cspray\Yape\EnumTrait; | |
final class Compass implements Enum { | |
use EnumTrait; | |
public static function North() : self { | |
return self::getSingleton('North'); | |
} | |
public static function South() : self { | |
return self::getSingleton('South'); | |
} | |
public static function East() : self { | |
return self::getSingleton('East'); | |
} | |
public static function West() : self { | |
return self::getSingleton('West'); | |
} | |
protected static function getAllowedValues() : array { | |
return ['North', 'South', 'East', 'West']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment