Skip to content

Commit 8f6c21c

Browse files
committed
[DI] Supports the deprecated tag in loaders
1 parent 4b6fab0 commit 8f6c21c

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function parseDefinition(\DOMElement $service, $file)
147147
$definition = new Definition();
148148
}
149149

150-
foreach (array('class', 'shared', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract') as $key) {
150+
foreach (array('class', 'shared', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract', 'deprecated') as $key) {
151151
if ($value = $service->getAttribute($key)) {
152152
if (in_array($key, array('factory-class', 'factory-method', 'factory-service'))) {
153153
@trigger_error(sprintf('The "%s" attribute of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED);

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ private function parseDefinition($id, $service, $file)
196196
$definition->setAbstract($service['abstract']);
197197
}
198198

199+
if (isset($service['deprecated'])) {
200+
$definition->setDeprecated($service['deprecated']);
201+
}
202+
199203
if (isset($service['factory'])) {
200204
if (is_string($service['factory'])) {
201205
if (strpos($service['factory'], ':') !== false && strpos($service['factory'], '::') === false) {

src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<xsd:attribute name="synchronized" type="boolean" />
9595
<xsd:attribute name="lazy" type="boolean" />
9696
<xsd:attribute name="abstract" type="boolean" />
97+
<xsd:attribute name="deprecated" type="boolean" />
9798
<xsd:attribute name="factory-class" type="xsd:string" />
9899
<xsd:attribute name="factory-method" type="xsd:string" />
99100
<xsd:attribute name="factory-service" type="xsd:string" />

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy