xxxxxxxxxx
class Example {
public const C_1 = 'val1';
public const C_2 = 'val2';
public const C_3 = 'val3';
/**
* @param string $c
*/
public function __construct(string $c)
{
if (!in_array($c, [self::C_1, self::C_2], true)) {
throw new InvalidArgumentException('Unsupported value');
}
}
}