Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed May 12, 2017
1 parent fbb0aca commit 18d0b03
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Contracts/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interface Store
/**
* Get a specific key from the settings data.
*
* @param string|array $key
* @param mixed $default
* @param string $key
* @param mixed $default
*
* @return mixed
*/
Expand Down
4 changes: 2 additions & 2 deletions src/SettingsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SettingsManager extends Manager implements SettingsManagerContract
*/
public function getDefaultDriver()
{
return $this->app['config']->get('settings.default', 'json');
return $this->config()->get('settings.default', 'json');
}

/* -----------------------------------------------------------------
Expand Down Expand Up @@ -82,7 +82,7 @@ private function getConfig($key, $default = null)
*/
private function registerDriver($driver, array $configs)
{
$this->extend($driver, function () use ($driver, $configs) {
$this->extend($driver, function () use ($configs) {
return new $configs['driver'](
$this->app, Arr::get($configs, 'options', [])
);
Expand Down
4 changes: 2 additions & 2 deletions src/Stores/AbstractStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ abstract protected function postOptions(array $options);
/**
* Get a specific key from the settings data.
*
* @param string|array $key
* @param mixed $default
* @param string $key
* @param mixed $default
*
* @return mixed
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Stores/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public function forget($key)
$segments = explode('.', $key);
array_pop($segments);

while ($segments) {
while ( ! empty($segments)) {
$segment = implode('.', $segments);

// non-empty array - exit out of the loop
if ($this->get($segment)) {
break;
}
if ($this->get($segment)) break;

// remove the empty array and move on to the next segment
$this->forget($segment);
array_pop($segments);
Expand Down
2 changes: 1 addition & 1 deletion src/Stores/JsonStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function read()
throw new RuntimeException("Invalid JSON file in [{$this->path}]");
}

return $data;
return (array) $data;
}

/**
Expand Down

0 comments on commit 18d0b03

Please sign in to comment.