3 declare(strict_types=1);
49 return $this->agents[
$key] ?? null;
55 unset($clone->agents[$key]);
61 if (isset($this->agents[$key])) {
62 throw new \LogicException(
"An agent with the name '$key' already exists.");
65 $clone->agents[
$key] = $agent;
74 foreach ($this->agents as
$c) {
75 if ($c->hasConfig()) {
87 return $this->
refinery->in()->series([
88 $this->
refinery->custom()->transformation(
function ($in): array {
90 foreach ($this->agents as
$key => $agent) {
91 if (!$agent->hasConfig()) {
94 $val = $in[
$key] ?? null;
95 $transformation = $agent->getArrayToConfigTransformation();
100 $this->
refinery->custom()->transformation(fn ($v): array => [$v]),
101 $this->
refinery->to()->toNew(ConfigCollection::class)
115 "Collected Install Objectives",
117 ...array_values(array_map(
125 array_keys($this->agents),
126 array_values($this->agents)
141 "Collected Update Objectives",
143 ...array_values(array_map(
150 array_keys($this->agents),
151 array_values($this->agents)
162 "Collected Build Artifact Objectives",
164 ...array_values(array_map(
177 "Collected Status Objectives",
179 ...array_values(array_map(
181 new Metrics\StorageOnPathWrapper($k, $storage)
183 array_keys($this->agents),
184 array_values($this->agents)
195 foreach ($this->agents as $agent_key => $agent) {
196 foreach ($agent->getMigrations() as $migration) {
200 $key = (new \ReflectionClass($migration))->getShortName();
201 $migrations[$agent_key .
"." .
$key] = $migration;
210 $names = explode(
"\\", get_class($migration));
211 return array_pop($names);
217 throw new \InvalidArgumentException(
218 "Expected ConfigCollection for configuration." 239 $namedObjectives = [];
241 foreach ($agents as $k => $agent) {
248 $namedObjectives[
"$k.$name"] = $constructor;
252 ksort($namedObjectives);
253 return $namedObjectives;
A objective collection is a objective that is achieved once all subobjectives are achieved...
getStatusObjective(Metrics\Storage $storage)
Get the objective to be achieved when status is requested.
getInstallObjective(Config $config=null)
An objective is a desired state of the system that is supposed to be created by the setup...
Class ChatMainBarProvider .
A migration is a potentially long lasting operation that can be broken into discrete steps...
getUpdateObjective(Config $config=null)
Get the goal the agent wants to achieve on update.
withAdditionalAgent(string $key, Agent $agent)
An agent that is just a collection of some other agents.
getBuildArtifactObjective()
Get the goal the agent wants to achieve to build artifacts.
getInstallObjective(Config $config=null)
Get the goals the agent wants to achieve on setup.
A agent is some component that performs part of the setup process.
getArrayToConfigTransformation()
getNamedObjectives(?Config $config=null)
withRemovedAgent(string $key)
hasConfig()
Does this agent require a configuration?
__construct(Refinery $refinery, array $agents)
getMigrations()
Get a named map of migrations available for this Agent.
checkConfig(Config $config)
getBuildArtifactObjective()
getUpdateObjective(Config $config=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getKey(Migration $migration)
A configuration for the setup.
A collection of some configurations.
getStatusObjective(Metrics\Storage $storage)