Skip to content

Commit

Permalink
Don't force users to match existing config
Browse files Browse the repository at this point in the history
If an object is in the registry already, and no bespoke config has been
specified - don't consider that an exceptional case.
  • Loading branch information
AD7six committed Nov 29, 2014
1 parent 8eded25 commit 9003857
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/ObjectRegistry.php
Expand Up @@ -116,6 +116,11 @@ protected function _checkDuplicate($name, $config) {
}
$existingConfig = $existing->config();
unset($config['enabled'], $existingConfig['enabled']);

if (empty($config)) {
return;
}

if ($hasConfig && json_encode($config) !== json_encode($existingConfig)) {
$msg .= ' with the following config: ';
$msg .= var_export($existingConfig, true);
Expand Down

0 comments on commit 9003857

Please sign in to comment.