Ulozi jmeno
@param string $name
@throws UniqueConstraintViolationException
@throws InvalidArgumentException
178283
public function setName(string $name): void
	{
		if ($name === '') {
			throw new InvalidArgumentException;
		}
		if (Strings::match($name, '/[^A-Za-z0-9_]/')) {
			throw new InvalidArgumentException('Name contains invalid characters');
		}

		/* @var $repository AclRolesRepository */
		$repository = $this->getRepository();
		$role = $repository->getByName($name);
		if ($role !== null && $role !== $this) {
			throw new UniqueConstraintViolationException("Role '$name' exists");
		}
		$this->name = $name;
	}
261396
public function offsetUnset($name)
    {
        $option = $this->findOption($name);

        if ($option instanceof Option) {
            unset($this->options[$option->getName()]);
        }
    }
826359
public static function remove($name)
    {
        if (!static::has($name)) {
            throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
        }

        unset(static::$map[$name], static::$types[$name]);
    }
481825
public function setName(string $name) : void
    {
        if ($name === "" || preg_match("/^([a-zA-Z0-9_])+$/", $name) !== 1) {
            throw new \InvalidArgumentException("Invalid cookie name. Use only a-zA-Z0-9 characters.");
        }

        $this->name = $name;
    }
21039
private function validateKeyName($name)
    {
        if (! is_string($name)) {
            throw InvalidArgumentException::invalidType('key', 'string', $name);
        }

        $len = strlen($name);
        if ($len > 255 || $len < 1) {
            throw InvalidArgumentException::invalidLength('name', 1, 255);
        }
    }
655191
public function lock($name)
    {
        if (!$this->has($name)) {
            throw new ItemNotFoundException($name);
        }

        $this->locked[$name] = true;

        return $this;
    }
258068
protected function throwIfNameIsInvalid($name)
    {
        if (!is_string($name)) {
            $actualType = gettype($name);
            $errorMessage = "The sheet's name is invalid. It must be a string ($actualType given).";
            throw new InvalidSheetNameException($errorMessage);
        }

        $failedRequirements = [];
        $nameLength = $this->stringHelper->getStringLength($name);

        if (!$this->isNameUnique($name)) {
            $failedRequirements[] = 'It should be unique';
        } else {
            if ($nameLength === 0) {
                $failedRequirements[] = 'It should not be blank';
            } else {
                if ($nameLength > self::MAX_LENGTH_SHEET_NAME) {
                    $failedRequirements[] = 'It should not exceed 31 characters';
                }

                if ($this->doesContainInvalidCharacters($name)) {
                    $failedRequirements[] = 'It should not contain these characters: \\ / ? * : [ or ]';
                }

                if ($this->doesStartOrEndWithSingleQuote($name)) {
                    $failedRequirements[] = 'It should not start or end with a single quote';
                }
            }
        }

        if (count($failedRequirements) !== 0) {
            $errorMessage = "The sheet's name (\"$name\") is invalid. It did not respect these rules:\n - ";
            $errorMessage .= implode("\n - ", $failedRequirements);
            throw new InvalidSheetNameException($errorMessage);
        }
    }
1038378
private function bakeFeature(string $name) : void
    {
        $this->pathFragment = 'Feature/Type/Module/';

        $this->bake($name, 'Feature/feature', ['name' => $name], 'Feature');
    }
757055
private function validateTagName(string $name): void
    {
        if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) {
            throw new \InvalidArgumentException(
                'The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, '
                . 'hyphens and backslashes.'
            );
        }
    }
523270
public function setName($name)
    {
        if (is_string($name) === true) {
            $this->name = $name;
        } else {
            $msg = "The 'name' argument must be a string, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
890151
private function blockBegin($name, $attributes)
    {
        $this->transformedTextStack->push('');
        $this->blockTypeStack->push($name);
        $this->blockAttributesStack->push($attributes);
    }
1191235
public static function createByName($name)
    {
        $constants = static::getConstantsByName();

        if (!array_key_exists($name, $constants)) {
            throw new UnexpectedValueException("Name '{$name}' is not exists in the enum constants list " . get_called_class());
        }

        return new static($constants[$name]);
    }
388052
public function setConstraintClass($name, $class)
    {
        // Ensure class exists
        if (!class_exists($class)) {
            throw new InvalidArgumentException('Unknown constraint ' . $name);
        }
        // Ensure class is appropriate
        if (!in_array('JsonSchema\Constraints\ConstraintInterface', class_implements($class))) {
            throw new InvalidArgumentException('Invalid class ' . $name);
        }
        $this->constraintMap[$name] = $class;

        return $this;
    }
1282737
public function execUp(string $name): void{
        DB::connection('default')->table('migrations')->insert(['name' => $name]);
        $this->up();
    }
193088
public function removeCustomByName($name)
    {
        if (array_key_exists($name, $this->_customByName)) {
            $element = $this->_customByName[$name];
            // Remove element
            unset($this->_customByName[$name]);
            // Be sure to delete from both arrays!
            $key = array_search($element, $this->_custom);
            unset($this->_custom[$key]);
        } else {
            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
            throw new Zend_Gdata_App_InvalidArgumentException(
                'Element does not exist.');
        }
        return $this;
    }
629777
public function setName(string $name) : void
    {
        if (empty($name)) {
            throw new InvalidArgumentException('Empty field name is not allowed');
        }

        $this->_name = $name;
    }
929188
public function setKeyName($name = "")
    {
        if (empty($name)) {
            throw new GdgCommonsInvalidArgumentException("Key name must not be null or empty");
        }
        
        if (!is_string($name)) {
            throw new GdgCommonsInvalidArgumentException("Key name must be string");
        }
        
        $this->_keyName = $name;
    }