Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
AuthenticationModel with patchKey replacing most replaceKey calls
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Mar 19, 2018
1 parent cb1ec00 commit 5acd7c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Model/AuthenticationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public function saveAuthenticationMap($auth, $module, $version = null)
422
);
}
$this->globalConfig->replaceKey($key, $auth);
$this->globalConfig->patchKey($key, $auth);
$this->localConfig->deleteKey($key);
return true;
}
Expand Down Expand Up @@ -598,8 +598,8 @@ protected function fetchOAuth2Configuration(array $config)
protected function patchHttpAuthConfig(AuthenticationEntity $entity, array $global, array $local)
{
$key = 'zf-mvc-auth.authentication.http';
$this->globalConfig->replaceKey($key, $global);
$this->localConfig->replaceKey($key, $local);
$this->globalConfig->patchKey($key, $global);
$this->localConfig->patchKey($key, $local);
}

/**
Expand All @@ -613,7 +613,7 @@ protected function patchHttpAuthConfig(AuthenticationEntity $entity, array $glob
protected function patchOAuth2Config(AuthenticationEntity $entity, array $global, array $local)
{
if (isset($global['route_match']) && $global['route_match']) {
$this->globalConfig->replaceKey('router.routes.oauth.options.route', $global['route_match']);
$this->globalConfig->patchKey('router.routes.oauth.options.route', $global['route_match']);
}

switch ($entity->getDsnType()) {
Expand All @@ -633,7 +633,7 @@ protected function patchOAuth2Config(AuthenticationEntity $entity, array $global
}

$key = 'zf-oauth2';
$this->localConfig->replaceKey($key, $toSet);
$this->localConfig->patchKey($key, $toSet);
}

/**
Expand Down Expand Up @@ -756,7 +756,7 @@ protected function saveAuthenticationAdapter(array $adapter)
break;
}

$this->localConfig->replaceKey($key, $config);
$this->localConfig->patchKey($key, $config);
$this->globalConfig->deleteKey($key);
return true;
}
Expand Down Expand Up @@ -803,7 +803,7 @@ protected function updateOAuth2Route($url)
'spec' => '%oauth%',
'regex' => '(?P<oauth>(' . implode('|', $routes) . '))',
];
$this->globalConfig->replaceKey('router.routes.oauth.options', $options);
$this->globalConfig->patchKey('router.routes.oauth.options', $options);
$this->globalConfig->replaceKey('router.routes.oauth.type', 'regex');
}

Expand Down Expand Up @@ -839,7 +839,7 @@ protected function removeOAuth2Route($url)
'spec' => '%oauth%',
'regex' => '(?P<oauth>(' . implode('|', $routes) . '))',
];
$this->globalConfig->replaceKey('router.routes.oauth.options', $options);
$this->globalConfig->patchKey('router.routes.oauth.options', $options);
$this->globalConfig->replaceKey('router.routes.oauth.type', 'regex');
return true;
}
Expand Down

0 comments on commit 5acd7c5

Please sign in to comment.