/** * @param string $name * @param int $index * * @return Set */ public function getElementsByTagName($name, $index = null) { if (is_null($index)) { return $this->set(parent::getElementsByTagName($name)); } return $this->ownerDocument->notEmpty($this->set(parent::getElementsByTagName($name))->item($index), $name); }
/** * @return Attr|Element|Tag|Field|Text|Cdata|Comment */ public function last() { if ($this->valid()) { $this->seek($this->count() - 1); return $this->current(); } return $this->ownerDocument->notEmpty(false, 'Set::last()'); }