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

Commit

Permalink
Remainder of patchKey calls have been changed to replaceKey.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Mar 19, 2018
1 parent 20e849d commit cb20ab0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 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->patchKey($key, $auth);
$this->globalConfig->replaceKey($key, $auth);
$this->localConfig->deleteKey($key);
return true;
}
Expand Down Expand Up @@ -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->patchKey('router.routes.oauth.options.route', $global['route_match']);
$this->globalConfig->replaceKey('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->patchKey($key, $toSet);
$this->localConfig->replaceKey($key, $toSet);
}

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions src/Model/DoctrineAdapterModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function __construct(ConfigResource $globalConfig, ConfigResource $localC
public function create($name, array $adapterConfig)
{
$key = "doctrine.connection.{$name}";
$this->globalConfig->patchKey($key, []);
$this->localConfig->patchKey($key, $adapterConfig);
$this->globalConfig->replaceKey($key, []);
$this->localConfig->replaceKey($key, $adapterConfig);

return new DoctrineAdapterEntity($name, $adapterConfig);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Model/InputFilterModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function addInputFilter($module, $controller, $inputFilter, $validator

if (! isset($config['zf-content-validation'][$controller])) {
$validatorName = $validatorName ?: $this->generateValidatorName($controller);
$config = $configModule->patchKey(
$config = $configModule->replaceKey(
['zf-content-validation', $controller, 'input_filter'],
$validatorName
);
Expand All @@ -150,7 +150,7 @@ protected function addInputFilter($module, $controller, $inputFilter, $validator

$config['input_filter_specs'][$validator] = $inputFilter;

$updated = $configModule->patchKey(['input_filter_specs', $validator], $inputFilter);
$updated = $configModule->replaceKey(['input_filter_specs', $validator], $inputFilter);
if (! is_array($updated)) {
return false;
}
Expand Down

0 comments on commit cb20ab0

Please sign in to comment.