We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1298b5 commit 26a30b4Copy full SHA for 26a30b4
src/DI/CompilerExtension.php
@@ -117,4 +117,19 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class)
117
{
118
}
119
120
+
121
+ /**
122
+ * Checks whether $config contains only $expected items.
123
+ * @return void
124
+ * @throws \Nette\InvalidStateException
125
+ */
126
+ protected function validate(array $config, array $expected, $name = NULL)
127
+ {
128
+ if ($extra = array_diff_key($config, $expected)) {
129
+ $name = $name ?: $this->name;
130
+ $extra = implode(", $name.", array_keys($extra));
131
+ throw new Nette\InvalidStateException("Unknown option $name.$extra.");
132
+ }
133
134
135
0 commit comments