Optimized code

This commit is contained in:
zcmzc 2019-06-25 11:46:18 +08:00
parent 204b1ac3da
commit cf6ad5b1e5
2 changed files with 2 additions and 4 deletions

View File

@ -21,7 +21,7 @@ interface ConfigInterface
* @param mixed $default default value of the entry when does not found
* @return mixed entry
*/
public function get(string $key, $default);
public function get(string $key, $default = null);
/**
* Returns true if the container can return an entry for the given identifier.

View File

@ -73,9 +73,7 @@ class Connector
*/
public function getOptions(array $config)
{
$options = $config['options'] ?? [];
return array_diff_key($this->options, $options) + $options;
return array_replace($this->options, $config['options'] ?? []);
}
/**