src/Constraints/HasElement.php
protected function hasAttributes(Crawler $element)
    {
        foreach ($this->attributes as $name => $value) {
            if (is_numeric($name)) {
                if (is_null($element->attr($value))) {
                    return false;
                }
            } else {
                if ($element->attr($name) != $value) {
                    return false;
                }
            }
        }

        return true;
    }
protected function hasAttributes(Crawler $element)
    {
        foreach ($this->attributes as $name => $value) {
            if (is_numeric($name)) {
                if (is_null($element->attr($value))) {
                    return false;
                }
            } else {
                if ($element->attr($name) != $value) {
                    return false;
                }
            }
        }

        return true;
    }
protected function hasAttributes ( Crawler $ element ) { foreach ( $ this -> attributes as $ name => $ value ) { if ( is_numeric ( $ name ) ) { if ( is_null ( $ element -> attr ( $ value ) ) ) { return false ; } } else { if ( $ element -> attr ( $ name ) != $ value ) { return false ; } } } return true ; }
Determines if the given element has the attributes.

@param  \Symfony\Component\DomCrawler\Crawler  $element
@return bool
Determines if the given element has the attributes .