Skip to content

Commit

Permalink
lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
steveworley committed Apr 21, 2021
1 parent 8994081 commit 7c16be0
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions src/Crawler/Group/ElementFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@
class ElementFilter extends GroupBase
{

/**
* The filtered type - used to separate output by id.
*
* @var string
*/
protected $filter_type;


/**
* {@inheritdoc}
*/
public function __construct(array $config=[])
{
parent::__construct($config);
$this->filter_type = NULL;
}

}//end __construct()


/**
* {@inheritdoc}
Expand All @@ -42,7 +50,9 @@ public function getId() : string
}

return $id;
}

}//end getId()


/**
* {@inheritdoc}
Expand Down Expand Up @@ -75,15 +85,18 @@ public function match($url, ResponseInterface $response) : bool
return FALSE;
}

$types = $element->each(function(Crawler $node) use ($filter_attr, $pattern) {
preg_match($pattern, $node->attr($filter_attr), $matches);
return reset($matches);
});
$types = $element->each(
function(Crawler $node) use ($filter_attr, $pattern) {
preg_match($pattern, $node->attr($filter_attr), $matches);
return reset($matches);
}
);

$this->filter_type = reset($types);

return TRUE;
}

}//end match()


}
}//end class

0 comments on commit 7c16be0

Please sign in to comment.