Browse Source

Don't force users to match existing config

If an object is in the registry already, and no bespoke config has been
specified - don't consider that an exceptional case.
AD7six 11 years ago
parent
commit
90038575dc
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Core/ObjectRegistry.php

+ 5 - 0
src/Core/ObjectRegistry.php

@@ -116,6 +116,11 @@ abstract class ObjectRegistry {
 		}
 		$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);