/** * 強制的に改行する (または強制的に改行しない) 要素名のリストをもとに, * 指定された要素を改行するかどうかを決定します. * 改行リスト・非改行リストの両方に含まれている要素名の場合は, * 改行リストのほうが優先されます. (つまり常に改行されます) * * 改行リスト・非改行リストのいずれにも含まれない場合は, * オリジナルの BreakControl の結果を返します. * * @param ContainerElement $node * @return bool */ public function breaks(ContainerElement $node) { $name = $node->getName(); if (in_array($name, $this->breakNames)) { return true; } if (in_array($name, $this->noBreakNames)) { return false; } return parent::breaks($node); }
/** * ContainerElement ノードのデバッグ文字列を出力します. * 出力内容は以下の通りです. * * <code> * ContainerElement(tagName) { * # 子ノードの出力内容 * } * </code> * * @param ContainerElement $node */ public function handleContainerElement(ContainerElement $node) { $name = $node->getName(); $this->startNode("ContainerElement({$name})"); $this->handleContainer($node); $this->endNode(); }