/** * Visit choice sub expression * * The return type of this method varies deping on the concrete visitor * implementation * * @param slRegularExpressionChoice $regularExpression * @return mixed */ protected function visitChoice(slRegularExpressionChoice $regularExpression) { $choice = $this->document->createElementNS('http://www.w3.org/2001/XMLSchema', 'choice'); foreach ($regularExpression->getChildren() as $child) { $choice->appendChild($this->visit($child)); } return $choice; }
/** * Visit choice sub expression * * The return type of this method varies deping on the concrete visitor * implementation * * @param slRegularExpressionChoice $regularExpression * @return mixed */ protected function visitChoice(slRegularExpressionChoice $regularExpression) { return '( ' . implode(' | ', array_map(array($this, 'visit'), $regularExpression->getChildren())) . ' )'; }