for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WSW\SiftScience\Support\AllowedValues;
use ReflectionClass;
/**
* Class BaseAllowedValues
*
* @package WSW\SiftScience\Support\AllowedValues
* @author Ronaldo Matos Rodrigues <[email protected]>
*/
abstract class BaseAllowedValues
{
* @return array
public static function getConstants()
return static::constants();
}
protected static function constants()
return (new ReflectionClass(get_called_class()))->getConstants();
* @param string $value
* @return bool
public static function isValid($value)
return in_array($value, static::constants());