Determine whether the form element with the given name has any validation errors

@param  string  $name
@return bool
7982
private function hasErrors($name)
    {
        if (is_null($this->session) || !$this->session->has('errors')) {
            return false;
        }
        // Get errors session
        $errors = $this->getErrorsSession();

        return $errors->has($this->transformKey($name));
    }
193882
public static function validName(string $name): bool
    {
        $enumerables = self::getCache();
        $keys = array_keys($enumerables);

        return \in_array($name, $keys, true);
    }
693659
public function isElementSelectable(string $name): bool
    {
        $position = $this->context->getElementPositionByText($name, $this->fields['listElement']);
        $checkbox = $this->context->findElement(sprintf($this->fields['tableCell'], $position, 1) . $this->fields['checkboxInput'])->getAttribute('disabled');

        return $checkbox !== 'disabled';
    }
695767
protected function isElementHasError(ElementInterface $element, FormInterface $form)
    {
        if ($element->getMessages()) {
            return true;
        }

        $elementName = $this->normalizeElementName($element->getName());
        $elements = $this->getInvalidFieldsetElements($element, $form);
        if (isset($elements[$elementName]) && $elements[$elementName] === $element) {
            return true;
        }

        return false;
    }
520607
protected function hasRule(string $name, string $field): bool
    {
        foreach ($this->_validations as $validation) {
            if ($validation['rule'] === $name && \in_array($field, $validation['fields'], true)) {
                return true;
            }
        }

        return false;
    }
893392
public function hasAttr(string $name): bool {
        return (bool)$this->collection()->reduce(function($carry, $node) use ($name) {
            if ($node->hasAttribute($name)) {
                return true;
            }

            return $carry;
        }, false);
    }
659647
public function hasElement($name)
    {
        foreach($this->elements as $element){
            if($element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
590521
public function hasFlag(string $name): bool
    {
        $flags = array();
        $flagEntry = $this->entry[PoTokens::FLAG];
        if (!empty($flagEntry)) {
            foreach ((array) $flagEntry as $csv) {
                $temp = str_getcsv($csv, ',');
                foreach ($temp as $flag) {
                    $flag = strtolower(trim($flag));
                    $flags[$flag] = $flag;
                }
            }
            return isset($flags[strtolower(trim($name))]);
        }
        return false;
    }
568854
public function hasMethod($name)
    {
        $methods = $this->getMethods();
        foreach ($methods as $method) {
            if ($method->getName() == $name) {
                return true;
            }
        }

        return false;
    }
244291
public function has(string $name): bool
    {
        return isset($this->stack[$this->normalizeName($name)]);
    }
488777
public function isElementNillable($name)
    {
        foreach ($this->element->getElementsByTagName('element') as $element) {
            if ($element->getAttribute('name') == $name && $element->getAttribute('nillable') == true) {
                return true;
            }
        }
        return false;
    }
167097
public function has(string $name): bool
    {
        foreach ($this->elements as $element) {
            if ($element instanceof NamedInterface && $element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
1102051
public function hasTag(string $name): bool
    {
        /** @var Tag $tag */
        foreach ($this->getTags() as $tag) {
            if ($tag->getName() === $name) {
                return true;
            }
        }

        return false;
    }
462073
private function hasFormProtection(string $name): bool
    {
        $key = $this->getSessionKey($name);

        return $this->session->has($key);
    }
1328480
private function isIgnoredTag(?string $name): bool
    {
        foreach (self::$ignoreTags as $tag) {
            if (strcasecmp($tag, $name) === 0) {
                return true;
            }
        }

        return false;
    }
99384
public function getValidationErrorsByName($name)
    {
        $errors = [];

        if ($this->name == $name) {
            $errors[] = $this;
        }

        $errors = array_merge($errors, $this->getValidationErrorsByNameRecursive($name, $this->subErrors));

        return $errors;
    }
588667
public function validateItemName($name)
    {
        $valid = true;
        $message = 'Valid item name.';
        if (!is_string($name))
        {
            $valid = false;
            $message = 'Only string values are allowed for item names!';
        }

        if (in_array($name, $this->invalidItemNames))
        {
            $valid = false;
            $message = sprintf('Item name is not allowed! Not allowed item names: %s',
                               implode(', ', $this->invalidItemNames));
        }

        if (preg_match(sprintf('/[%s]/', $this->invalidCharsForItemNames), $name) > 0)
        {
            $valid = false;
            $message = sprintf('Invalid name for ini item! Provided item name contains not ' .
                               'allowed chars (%s).', $this->invalidCharsForItemNames);
        }

        return [$valid, $message];
    }