/** * Guard string method to be called with Crawler object * @throws \InvalidArgumentException */ protected function guardText() { if (is_object($this->node)) { $this->node = $this->node->text(); } }