Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace Consolidation\Config\Util;
|
||||
|
||||
/**
|
||||
* Works like 'getWithFallback', but merges results from all applicable
|
||||
* groups. Settings from most specific group take precedence.
|
||||
*/
|
||||
class ConfigMerge extends ConfigGroup
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
return $this->getWithMerge($key, $this->group, $this->prefix, $this->postfix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge available configuration from each configuration group.
|
||||
*/
|
||||
public function getWithMerge($key, $group, $prefix = '', $postfix = '.')
|
||||
{
|
||||
$configKey = "{$prefix}{$group}${postfix}{$key}";
|
||||
$result = $this->config->get($configKey, []);
|
||||
if (!is_array($result)) {
|
||||
throw new \UnexpectedValueException($configKey . ' must be a list of settings to apply.');
|
||||
}
|
||||
$moreGeneralGroupname = $this->moreGeneralGroupName($group);
|
||||
if ($moreGeneralGroupname) {
|
||||
$result += $this->getWithMerge($key, $moreGeneralGroupname, $prefix, $postfix);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user