Cleans name.

@param string $name

@return Name
@throws RuntimeException
@throws InvalidArgumentException
547562
public function cleanName($name)
    {
        $response = $this->query($this->prepareUri('clean/name'), [$name]);
        $result = $this->populate(new Name(), $response);
        if (!$result instanceof Name) {
            throw new RuntimeException('Unexpected populate result: ' . get_class($result). '. Expected: ' . Name::class);
        }

        return $result;
    }
118969
private static function validateName(string $name) : string
  {
    if (empty($name) || preg_match("/[=,; \t\r\n\013\014]/", $name)) {
      throw new \InvalidArgumentException(sprintf('Invalid name \'%s\'.', $name));
    }

    return $name;
  }
776321
protected function getRuleClassName(string $name): string
	{
		if(!isset($this->rules[$name]))
		{
			throw new RuntimeException(vsprintf('Call to undefined validation rule [ %s ].', [$name]));
		}

		return $this->rules[$name];
	}
1282839
public function getNamedRoute(string $name): Route
	{
		if(!isset($this->namedRoutes[$name]))
		{
			throw new RuntimeException(vsprintf('No route named [ %s ] has been defined.', [$name]));
		}

		return $this->namedRoutes[$name];
	}
300295
public function removeProperty($name)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, (is_object($name) ? get_class($name) : gettype($name))));
        }

        $this->parseStyleAttribute();

        unset($this->properties[$name]);

        $this->updateStyleAttribute();

        return $this;
    }
727879
public function instanceName($name = null)
    {
        if ($name === null) {
            return $this->instanceName;
        }

        // Rename:
        unset(self::$instances[$this->instanceName]);
        $this->instanceName = $name;
        self::$instances[$name] = $this;
        return $this;
    }
29760
public function name($name = null)
    {
        if (null === $name) {
            return $this->name;
        }

        $this->name = $name;

        return $this;
    }
309427
private function removeConfig($name)
    {
        try {
            $this->configFactory->getEditable($name)->delete();
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage());
        }
    }
311194
public function removeName(Name $name)
    {
        if ($this->names->contains($name)) {
            $this->names->removeElement($name);
            $name->setItem(null);
        }

        return $this;
    }
451914
public function getCleanValue($name)
    {
        if (array_key_exists($name, $this->_cleanData)) {
            return $this->_cleanData[$name];
        }
        foreach ($this->_getSiblingRows() as $r) {
            if (array_key_exists($name, $r->_cleanData)) {
                return $r->_cleanData[$name];
            }
        }
        return $this->__get($name);
    }
760506
public function set_name($name)
    {
        $previous_name = $this->name;

        $name = self::generateName($name, $this->app['unicode']);

        if ($name === '') {
            throw new \Exception_InvalidArgument();
        }

        $this->name = $name;

        if ($this->name !== $previous_name) {
            $this->renamed = true;
        }

        return $this;
    }
193315
public function removeFieldByName($name)
    {
        foreach ($this->fields as $i => $field) {
            if ($field->getName() == $name) {
                unset($this->fields[$i]);
                break;
            }
        }

        return $this;
    }
497939
public function & getMemberByName( $name )
	{
		if( isset( $this->members[$name] ) )
			return $this->members[$name];
		throw new RuntimeException( "Member '$name' is unknown" );
	}
1262329
static public function del($name)
    {
        if (isset(Loader::$callback['CacheDel'])) {
            return call_user_func_array(Loader::$callback['CacheDel'], func_get_args());
        }
        return self::check() && @unlink(self::$cachepath . $name);
    }
68429
public static function clean($name)
    {
        $index_prefix = Config::get('larasearch.elasticsearch.index_prefix', '');
        if ($index_prefix && !Str::startsWith($name, $index_prefix)) $name = $index_prefix . $name;

        $indices = self::getClient()->indices()->getAliases();
        foreach ($indices as $index => $value)
        {
            if (empty($value['aliases']) && preg_match("/^${name}_\\d{14,17}$/", $index))
            {
                self::getClient()->indices()->delete(['index' => $index]);
            }
        }
    }
629364
public function clear($name)
    {
        // Get var by path
        $var = $this->nestedValue($name, $this->data);

        // Unset var
        if ($var !== null) {
            // Unset parent key
            $parentParts = explode('.', $name);
            $basePart = array_pop($parentParts);
            if ($parentParts) {
                $parent = &$this->nestedValueRef(implode('.', $parentParts), $this->data);
                unset($parent[$basePart]);
            } else {
                unset($this->data[$name]);
            }
            $this->markChanged($name);
        }
        return $this;
    }
1106675
protected function cleanFileName($name)
    {
        $title = Str::ascii($name);

        // Convert all dashes/underscores into separator
        $flip = $separator = '-';
        $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);

        // Remove all characters that are not the separator, letters, numbers, whitespace or @.
        $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s@]+!u', '', mb_strtolower($title));

        // Replace all separator characters and whitespace by a single separator
        $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title);

        return trim($title, $separator);
    }