Validates a DynamoDB table name.

@see http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

@param $name string The table name to validate.

@throws InvalidArgumentException When the name is invalid.
329764
private function validateTableName($name)
    {
        if (! is_string($name)) {
            throw InvalidArgumentException::invalidType('key', 'string', $name);
        }

        if (! preg_match('/^[a-z0-9_.-]{3,255}$/i', $name)) {
            throw InvalidArgumentException::invalidTableName($name);
        }
    }
736029
public function setTableName(string $tableName): void
    {
        $tableName = trim($tableName);

        if (empty($tableName)) {
            throw new InvalidArgumentException('tableName cannot be empty');
        }

        $this->tableName = $tableName;
    }
16732
public function setName($name)
    {
        if (is_string($name) === false) {
            $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }

        $this->name = $name;
    }
114449
public function setName($name)
  {
    if (ThrottlerHelper::validateName($name) && !$this->isActive()) {
      $this->name = $name;
      return true;
    }
    return false;
  }
947720
public static function fromQName( $name )
	{
		if ( $name instanceof QName )
		{
			$name = "{$name->prefix}:{$name->localName}";
		}
		if ( ! is_string( $name ) )
		{
			throw new \InvalidArgumentException( "$name must be string or a QName instanxe" );
		}

		$types = SchemaTypes::getInstance();
		$attribute = $types->getElement( $name );

		if ( ! $attribute )
		{
			return null;
		}

		$result = new DOMSchemaAttribute();
		error_log( __CLASS__ . " need to populate the DOMSchemaAttribute instance" );
		return $result;
	}
1153939
public static function validateReleaseFormat($name)
    {
        self::validateReleaseFormatForHyphen($name);
        list($adjective, $noun) = explode('-', $name);

        if ($adjective[0] != $noun[0]) {
            throw new \Exception('Invalid combination of release name: ' . $name);
        }
    }
918657
public static function normalize($name)
	{
		$name = (string) $name;

		if (!static::isValid($name))
		{
			throw new InvalidArgumentException("Invalid parameter name '" . $name . "'");
		}

		return $name;
	}
1087027
public static function valid_alternative_database_name($name)
    {
        if (Director::isLive() || empty($name)) {
            return false;
        }

        $prefix = Environment::getEnv('SS_DATABASE_PREFIX') ?: 'ss_';
        $pattern = strtolower(sprintf('/^%stmpdb\d{7}$/', $prefix));
        return (bool)preg_match($pattern, $name);
    }
412776
public function checkFieldName($name, $className)
    {
        if (!$name || trim($name) == '') {
            throw new \InvalidArgumentException(
                "Please provide valid field name for class [{$className}]"
            );
        }

        if (in_array($name, static::$reservedFieldNames)) {
            throw new \InvalidArgumentException(
                "Field name [{$name}] in form [{$className}] is a reserved word. Please use a different field name." .
                "\nList of all reserved words: " . join(', ', static::$reservedFieldNames)
            );
        }

        return true;
    }
974163
protected function checkNameIsNotBlacklisted(string $name): void
    {
        if (Str::contains($name, $this->blacklisted)) {
            throw new InvalidArgumentException("Invalid character in driver name [{$name}].");
        }
    }
238066
private function checkName(&$name)
    {
        if (! is_string($name)) {
            throw new InvalidTypeException(
                'The tag type must be a string, ' . gettype($name) . ' is given.'
            );
        }

        $name = strtolower(trim($name));
    }
611742
public function start($name)
    {
        if (\in_array($name, $this->openSlots)) {
            throw new \InvalidArgumentException(sprintf('A slot named "%s" is already started.', $name));
        }

        $this->openSlots[] = $name;
        $this->slots[$name] = '';

        ob_start();
        ob_implicit_flush(0);
    }
789160
private function init($name, $first = 0)
    {
        if (null !== $this->find($name)) {
            throw new InvalidArgumentException(sprintf('Sequence with name %s already exists', $name));
        }

        if (false === Numeric::isPositiveInteger($first, false)) {
            throw new InvalidArgumentException('Initial value of a sequence must be a positive integer');
        }

        $query = 'INSERT INTO sequence (name, value) VALUE(:name, :value)';
        $params = array(
            'name'   => $name,
            'value'  => $first,
        );

        $this->getEntityManager()
            ->getConnection()
            ->executeUpdate($query, $params)
        ;

        return $first;
    }
483357
public function setName($name)
    {
        if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
        }

        $this->name = $name;

        return $this;
    }
96388
public function setName($name)
	{
		if ( ! is_string($name))
		{
			throw new \InvalidArgumentException('The name must be a string');
		}

		Arr::set($this->attributes, 'name', $name);

		return $this;
	}
879887
public function setName($name)
    {
        if (strpos(self::PATH_SEPARATOR, $name) !== false) {
            throw new \InvalidArgumentException(
                'Invalid character "' . self::PATH_SEPARATOR . '" in resource name.'
            );
        }

        $this->name = $name;
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }