public function __construct($template, array $options = array()) { $template = preg_replace_callback('#^\\+([^\\+]+)\\+#', function ($match) use(&$delimiter) { $delimiter = $match[1]; return ''; }, $template); parent::__construct($template, $options); if (isset($delimiter)) { $this->delimiter = $delimiter; } $itemsCount = count($this->template); $this->permutation = new Permutation($itemsCount); $firstSequence = $this->permutation->current(); $this->sequenceArray[0] = $firstSequence; $this->currentTemplateKeySequence = $firstSequence; }
public function testInner() { $str = "1 {2|3}|4 {5|6}"; $part = new XorPart($str); $this->assertNotEquals("", $part->generate(true)); }