コード例 #1
0
 /**
  * @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
ファイル: Node.php プロジェクト: madkom/nginx-configurator
 /**
  * Append new child node
  * @param Node $node
  * @return bool
  */
 public function append(Node $node) : bool
 {
     $node->parent = $this;
     return $this->childNodes->add($node);
 }