Commit cc26b290 authored by Armando Lüscher's avatar Armando Lüscher

Command getConfig should return "null" if no config key is found.

parent 1e325d88
......@@ -178,7 +178,7 @@ abstract class Command
/**
* Get command config
*
* Look for config $name if found return it, if not return empty array.
* Look for config $name if found return it, if not return null.
* If $name is not set return all set config.
*
* @param string|null $name
......@@ -193,7 +193,7 @@ abstract class Command
if (isset($this->config[$name])) {
return $this->config[$name];
}
return [];
return null;
}
/**
......
......@@ -191,6 +191,6 @@ class CommandTest extends TestCase
$this->assertEquals(['config_key' => 'config_value'], $this->command_stub_with_config->getConfig(null));
$this->assertEquals(['config_key' => 'config_value'], $this->command_stub_with_config->getConfig());
$this->assertEquals('config_value', $this->command_stub_with_config->getConfig('config_key'));
$this->assertEquals([], $this->command_stub_with_config->getConfig('not_config_key'));
$this->assertEquals(null, $this->command_stub_with_config->getConfig('not_config_key'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment