Skip to content

Commit

Permalink
Fix some typos in constructor and getWithMerge method.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Jun 26, 2017
1 parent a8d0e1a commit 5fec42d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Util/ApplyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ApplyConfig
{
protected $config;

public function __constructor($config, $group, $prefix = '', $postfix = '.')
public function __construct($config, $group, $prefix = '', $postfix = '.')
{
if (!empty($group) && empty($postfix)) {
$postfix = '.';
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ConfigGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class ConfigGroup
protected $prefix;
protected $postfix;

public function __constructor($config, $group, $prefix = '', $postfix = '.')
public function __construct($config, $group, $prefix = '', $postfix = '.')
{
$this->config = $config;
$this->group = $group;
Expand Down
12 changes: 6 additions & 6 deletions src/Util/ConfigMerge.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public function getWithMerge($key, $group, $prefix = '', $postfix = '.')
{
$configKey = "{$prefix}{$group}${postfix}{$key}";
$result = [];
if ($this->has($configKey)) {
$result = $this->get($configKey);
} elseif ($this->hasDefault($configKey)) {
$result = $this->getDefault($configKey);
if ($this->config->has($configKey)) {
$result = $this->config->get($configKey);
} elseif ($this->config->hasDefault($configKey)) {
$result = $this->config->getDefault($configKey);
}
if (!is_array($result)) {
throw new \UnexpectedValueException($configKey . ' must be a list of settings to apply.');
}
$moreGeneralGroupname = preg_replace('#\.[^.]*$#', '', $group);
if ($moreGeneralGroupname != $group) {
$moreGeneralGroupname = $this->moreGeneralGroupName($group);
if ($moreGeneralGroupname) {
$result += $this->getWithMerge($key, $moreGeneralGroupname, $prefix, $postfix);
}
return $result;
Expand Down

0 comments on commit 5fec42d

Please sign in to comment.