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