public static function validate(string $key, string $prefix): string
    {
        if (in_array($key, self::$keys)) {
            throw new InvalidArgumentException("The key [$key] is not unique.");
        }

        if (strpos($key, $prefix) === false) {
            throw new InvalidArgumentException("The key must be prefixed with [$prefix].");
        }

        return $key;
    }
public static function validate(string $key, string $prefix): string
    {
        if (in_array($key, self::$keys)) {
            throw new InvalidArgumentException("The key [$key] is not unique.");
        }

        if (strpos($key, $prefix) === false) {
            throw new InvalidArgumentException("The key must be prefixed with [$prefix].");
        }

        return $key;
    }
public static function validate ( string $ key , string $ prefix ) : string { if ( in_array ( $ key , self :: $ keys ) ) { throw new InvalidArgumentException ( "The key [$key] is not unique." ) ; } if ( strpos ( $ key , $ prefix ) === false ) { throw new InvalidArgumentException ( "The key must be prefixed with [$prefix]." ) ; } return $ key ; }
Validate a given key's uniqness.

@param string $key
@param string $prefix

@throws \InvalidArgumentException

@return string
Validate a given key s uniqness .