Skip to content

Instantly share code, notes, and snippets.

@cspray
Last active October 20, 2019 09:12
Show Gist options
  • Save cspray/d5bbd816ef315e5564f1c2b3e8fa45fe to your computer and use it in GitHub Desktop.
Save cspray/d5bbd816ef315e5564f1c2b3e8fa45fe to your computer and use it in GitHub Desktop.
<?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