You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor symfony#14798 [DependencyInjection] provide better error message when using deprecated configuration options (xabbuh)
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] provide better error message when using deprecated configuration options
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony#14687
| License | MIT
| Doc PR |
Commits
-------
e1e7440 [DependencyInjection] provide better error message when using deprecated configuration options
if (in_array($key, array('factory-class', 'factory-method', 'factory-service'))) {
154
+
trigger_error(sprintf('The "%s" attribute in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, $file), E_USER_DEPRECATED);
155
+
}
152
156
$method = 'set'.str_replace('-', '', $key);
153
157
$definition->$method(XmlUtils::phpize($value));
154
158
}
155
159
}
156
160
157
161
if ($value = $service->getAttribute('synchronized')) {
trigger_error(sprintf('The "synchronized" attribute in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
@@ -201,14 +202,17 @@ private function parseDefinition($id, $service, $file)
201
202
}
202
203
203
204
if (isset($service['factory_class'])) {
205
+
trigger_error(sprintf('The "factory_class" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
trigger_error(sprintf('The "factory_method" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
trigger_error(sprintf('The "factory_service" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
0 commit comments