Returns true if this block can contain the given block as a child node
abstract public canContain ( |
||
$block | ||
리턴 | boolean |
/** * @param AbstractBlock $block * * @return AbstractBlock */ public function addBlock(AbstractBlock $block) { $this->getBlockCloser()->closeUnmatchedBlocks(); $block->setStartLine($this->lineNumber); while (!$this->tip->canContain($block)) { $this->tip->finalize($this); } $this->tip->addChild($block); $this->tip = $block; $this->container = $block; return $block; }