Initial and very naive conversion v2.0 => v2.1 (#10)
This commit is contained in:
@@ -12,12 +12,14 @@ class Environment implements \ArrayAccess
|
||||
protected array $vars = [];
|
||||
|
||||
/**
|
||||
* @param object $env
|
||||
* @param object|null $env
|
||||
*/
|
||||
public function __construct(protected object $env)
|
||||
public function __construct(protected ?object $env)
|
||||
{
|
||||
foreach ($env->values as $var) {
|
||||
$this->vars[static::formatKey($var->key)] = $var->value;
|
||||
if (!empty($env->values)) {
|
||||
foreach ($env->values as $var) {
|
||||
$this->vars[static::formatKey($var->key)] = $var->value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user