public static function guardAgainstInvalidNumeric($numeric)
    {
        if (!is_string($numeric)) {
            throw new InvalidArgumentException(
                sprintf('Expected $numeric to be of type string, got: %s', gettype($numeric))
            );
        }

        if (!preg_match('/^[0-9]{3}$/', $numeric)) {
            throw new DomainException(
                sprintf('Not a valid numeric key: %s', $numeric)
            );
        }
    }
public static function guardAgainstInvalidNumeric($numeric)
    {
        if (!is_string($numeric)) {
            throw new InvalidArgumentException(
                sprintf('Expected $numeric to be of type string, got: %s', gettype($numeric))
            );
        }

        if (!preg_match('/^[0-9]{3}$/', $numeric)) {
            throw new DomainException(
                sprintf('Not a valid numeric key: %s', $numeric)
            );
        }
    }
public static function guardAgainstInvalidNumeric ( $ numeric ) { if ( ! is_string ( $ numeric ) ) { throw new InvalidArgumentException ( sprintf ( 'Expected $numeric to be of type string, got: %s' , gettype ( $ numeric ) ) ) ; } if ( ! preg_match ( '/^[0-9]{3}$/' , $ numeric ) ) { throw new DomainException ( sprintf ( 'Not a valid numeric key: %s' , $ numeric ) ) ; } }
Assert that input looks like a numeric key.

@param string $numeric

@throws \League\ISO3166\Exception\InvalidArgumentException if input is not a string
@throws \League\ISO3166\Exception\DomainException if input does not look like a numeric key
Assert that input looks like a numeric key .