ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Tentatively.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Setup\Objective;
22
23use ILIAS\Setup;
24
30{
32
34 {
35 $this->other = $other;
36 }
37
38 public function getHash(): string
39 {
40 if ($this->other instanceof Tentatively) {
41 return $this->other->getHash();
42 }
43 return "tentatively " . $this->other->getHash();
44 }
45
46 public function getLabel(): string
47 {
48 if ($this->other instanceof Tentatively) {
49 return $this->other->getLabel();
50 }
51 return "Tentatively: " . $this->other->getLabel();
52 }
53
54 public function isNotable(): bool
55 {
56 return $this->other->isNotable();
57 }
58
59 /*
60 * @inheritdocs
61 */
62 public function getPreconditions(Setup\Environment $environment): array
63 {
64 if ($this->other instanceof Tentatively) {
65 return $this->other->getPreconditions($environment);
66 }
67 return array_map(
68 function ($p): \ILIAS\Setup\Objective\Tentatively {
69 if ($p instanceof Tentatively) {
70 return $p;
71 }
72 return new Tentatively($p);
73 },
74 $this->other->getPreconditions($environment)
75 );
76 }
77
81 public function achieve(Setup\Environment $environment): Setup\Environment
82 {
83 try {
84 return $this->other->achieve($environment);
86 }
87 return $environment;
88 }
89
93 public function isApplicable(Setup\Environment $environment): bool
94 {
95 return $this->other->isApplicable($environment);
96 }
97}
A wrapper around an objective that attempts to achieve the wrapped objective but won't stop the proce...
Definition: Tentatively.php:30
achieve(Setup\Environment $environment)
@inheritdocs
Definition: Tentatively.php:81
isNotable()
Get to know if this is an interesting objective for a human.
Definition: Tentatively.php:54
getPreconditions(Setup\Environment $environment)
Definition: Tentatively.php:62
isApplicable(Setup\Environment $environment)
@inheritDoc
Definition: Tentatively.php:93
__construct(Setup\Objective $other)
Definition: Tentatively.php:33
getHash()
Get a hash for this objective.
Definition: Tentatively.php:38
getLabel()
Get a label that describes this objective.
Definition: Tentatively.php:46
Signals that some goal won't be achievable by actions of the system ever.
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.