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