/** * @param BlockNode $node * * @return string */ protected function printBlockNode(BlockNode $node) { $childNodes = $node->getChildNodes(); if ($node->isSubPattern()) { $output = ''; foreach ($childNodes as $childNode) { $output .= $this->printNode($childNode); } return $output; } return $this->printNode($childNodes[mt_rand(0, count($childNodes) - 1)]); }