3 declare(strict_types=1);
    33     protected function achieveObjective(
    35         Environment $environment,
    38         $iterator = 
new ObjectiveIterator($environment, $objective);
    41         register_shutdown_function(
static function () use (&$current) {
    42             if (null !== $current) {
    43                 throw new \RuntimeException(
"Objective '{$current->getLabel()}' failed because it halted the program.");
    47         while ($iterator->valid()) {
    48             $current = $iterator->current();
    49             if (!$current->isApplicable($environment)) {
    56                 $io->startObjective($current->getLabel(), $current->isNotable());
    59                 $environment = $current->achieve($environment);
    61                     $io->finishedLastObjective();
    63                 $iterator->setEnvironment($environment);
    64             } 
catch (NotExecutableException 
$e) {
    67                 $iterator->markAsFailed($current);
    70                     $io->failedLastObjective();
    71                     if ($io->isVerbose()) {
    72                         $message .= 
"\n\n" . $e->getTraceAsString();
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...