31 if (!isset($this->resources[$id])) {
34 return $this->resources[$id];
42 if (isset($this->resources[$id])) {
43 throw new \RuntimeException(
44 "Resource '$id' is already contained in the environment"
48 $clone->resources[$id] = $resource;
57 if (isset($this->configs[$component])) {
58 throw new \RuntimeException(
59 "Config for '$component' is already contained in the environment"
63 $clone->configs[$component] =
$config;
72 if (!isset($this->configs[$component])) {
73 throw new \RuntimeException(
74 "Config for '$component' is not contained in the environment"
77 return $this->configs[$component];
An exception for terminatinating execution or to throw for unit testing.
__construct(array $resources)
withResource(string $id, $resource)
RuntimeException if this resource is already in the environment.
withConfigFor(string $component, $config)
Stores a config for some component in the environment.RuntimeException if this config is already in t...
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.implements some known in...
getConfigFor(string $component)
RuntimeException if there is no config for the component mixed
An environment holds resources to be used in the setup process.