예제 #1
0
파일: Selector.php 프로젝트: dev-lucid/html
 public function test(TagInterface $tag) : bool
 {
     $matches = true;
     if (is_null($this->tag) === false) {
         if ($this->tag != $tag->getTag()) {
             $matches = false;
         }
     }
     if (is_null($this->class) === false) {
         if ($tag->hasClass($this->class) === false) {
             $matches = false;
         }
     }
     if (is_null($this->attributeName) === false) {
         if ($this->attributeValue != $tag->get($this->attributeName)) {
             $matches = false;
         }
     }
     return $matches;
 }