Skip to content

Commit

Permalink
Merge pull request #20 from lenvanessen/lenvanessen-patch-1
Browse files Browse the repository at this point in the history
Fix for issue #16
  • Loading branch information
SahAssar committed Sep 21, 2017
2 parents 4a5becd + fdc1fdd commit 3ef9f2b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function __construct($config)
{
parent::__construct($config);

if (!isset($config['redirects']) || ! is_array($config['redirects'])) {
$config['redirects'] = [];
}

$this->remove('redirects');
foreach ($config['redirects'] as $name => $parameters) {
if (!is_array($parameters)) {
Expand All @@ -29,6 +33,10 @@ public function __construct($config)
}
}

if (!isset($config['jits']) || ! is_array($config['jits'])) {
$config['jits'] = [];
}

$this->remove('jits');
foreach ($config['jits'] as $name => $parameters) {
if (!is_array($parameters)) {
Expand Down Expand Up @@ -86,4 +94,13 @@ public function setVariables(array $variables)
{
$this->set('variables', $variables);
}

/**
* Get slightly tweaked so the default response is an array
* {@inheritdoc}
*/
public function get($key, $default = null, $deep = false)
{
return parent::get($key, $default = [], $deep);
}
}

0 comments on commit 3ef9f2b

Please sign in to comment.