/** * @inheritDoc */ public function add($element) : bool { if ($this->contains($element)) { throw new RuntimeException("Given element already exists in collection"); } return parent::add($element); }
/** * @return string */ public function __toString() : string { return sprintf("{$this->name} %s;", implode(' ', (array) $this->params->getIterator())); }
/** * @return string */ public function __toString() : string { return (string) implode("\n", (array) $this->childNodes->getIterator()); }