19 declare(strict_types=1);
45 return new class ($name) extends
NullStep {
63 bool $leads_exactly_to_one
65 return new class ($steps, $is_relative, $leads_exactly_to_one) extends
NullPath {
70 protected array $steps,
71 protected bool $is_relative,
72 protected bool $leads_exactly_to_one
76 public function isRelative():
bool 78 return $this->is_relative;
81 public function leadsToExactlyOneElement():
bool 83 return $this->leads_exactly_to_one;
86 public function steps(): \Generator
88 yield
from $this->steps;
98 array $step_conditions_dict
106 protected array $conditions
112 return $this->path_without_conditions;
115 public function getConditionPathByStepName(
string $name):
PathInterface 117 if (!key_exists($name, $this->conditions)) {
120 return $this->conditions[$name];
129 array $steps_has_elements
131 return new class ($steps_has_elements) extends
NullNavigator {
132 protected int $index;
136 public function __construct(
protected array $step_has_elements)
143 $clone = clone $this;
145 if ($clone->index >= count($this->step_has_elements)) {
153 $clone = clone $this;
155 if ($clone->index < 0) {
161 public function hasNextStep():
bool 163 return $this->index < (count($this->step_has_elements) - 1);
166 public function hasPreviousStep():
bool 168 return $this->index > 0;
171 public function hasElements():
bool 173 return $this->index === -1 || $this->step_has_elements[$this->index];
188 protected function stepsToBoolArray(
StepInterface ...$steps): array
191 foreach ($steps as $step) {
192 $step_str = $step->name() instanceof
StepToken ? $step->name()->value : $step->name();
193 $has_elements[] = str_ends_with($step_str,
'has_elements');
195 return $has_elements;
200 return $this->test->getNavigatorMock($this->stepsToBoolArray(...$path->
steps()));
220 $path_without_conditions,
227 $path_checker->isPathConditionMet($this->getStepMock(
'start'), $this->
getElementMock())
230 $path_checker->isPathConditionMet($this->getStepMock(
'step1'), $this->
getElementMock())
233 $path_checker->isPathConditionMet($this->getStepMock(
'step2'), $this->
getElementMock())
236 $path_checker->isPathConditionMet($this->getStepMock(
'end'), $this->
getElementMock())
239 $path_checker->isPathConditionMet($this->getStepMock(
'not_a_step'), $this->
getElementMock())
257 $path_without_conditions,
298 $path_checker->isPathConditionMet($this->getStepMock(
'start'), $this->
getElementMock())
301 $path_checker->isPathConditionMet($this->getStepMock(
'step1'), $this->
getElementMock())
304 $path_checker->isPathConditionMet($this->getStepMock(
'step2'), $this->
getElementMock())
307 $path_checker->isPathConditionMet($this->getStepMock(
'end'), $this->
getElementMock())
310 $path_checker->isPathConditionMet($this->getStepMock(
'not_a_step'), $this->
getElementMock())
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.