Skip to content

Commit

Permalink
Merge branch 'hotfix/27'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Nov 1, 2017
2 parents 109b8ca + 4a654e6 commit 09f5af9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 3 additions & 5 deletions src/ConfigResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,8 @@ public function replaceKey($keys, $value, array $config)

$key = array_shift($keys);

$haveKeys = (count($keys) > 0) ? true : false;

// If no more keys, overwrite and return
if (! $haveKeys) {
if (! $keys) {
$config[$key] = $value;
return $config;
}
Expand Down Expand Up @@ -307,7 +305,7 @@ public function createNestedKeyValuePair(&$patchValues, $key, $value)
protected function extractAndSet(array $keys, $value, &$array)
{
$key = array_shift($keys);
if (count($keys)) {
if ($keys) {
if (! isset($array[$key]) || ! is_array($array[$key])) {
$array[$key] = [];
}
Expand All @@ -331,7 +329,7 @@ protected function deleteByKey(&$array, array $keys)
return;
}

if (1 > count($keys)) {
if (! $keys) {
unset($array[$key]);
return;
}
Expand Down
8 changes: 2 additions & 6 deletions src/ModuleUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public function __construct(ModuleManager $modules)
public function getModulePath($moduleName)
{
$moduleName = $this->normalizeModuleName($moduleName);
if (isset($this->moduleData[$moduleName])
&& isset($this->moduleData[$moduleName]['path'])
) {
if (isset($this->moduleData[$moduleName]['path'])) {
return $this->moduleData[$moduleName]['path'];
}

Expand All @@ -63,9 +61,7 @@ public function getModulePath($moduleName)
public function getModuleConfigPath($moduleName)
{
$moduleName = $this->normalizeModuleName($moduleName);
if (isset($this->moduleData[$moduleName])
&& isset($this->moduleData[$moduleName]['config'])
) {
if (isset($this->moduleData[$moduleName]['config'])) {
return $this->moduleData[$moduleName]['config'];
}

Expand Down

0 comments on commit 09f5af9

Please sign in to comment.