+ /**
+ * Validates an alias.
+ *
+ * @param \DOMElement $alias
+ * @param string $file
+ */
+ private function validateAlias(\DOMElement $alias, $file)
+ {
+ foreach ($alias->attributes as $name => $node) {
+ if (!in_array($name, array('alias', 'id', 'public'))) {
+ @trigger_error(sprintf('Using the attribute "%s" is deprecated for the service "%s" which is defined as an alias in "%s". Allowed attributes for service aliases are "alias", "id" and "public". The XmlFileLoader will raise an exception in Symfony 4.0, instead of silently ignoring unsupported attributes.', $name, $alias->getAttribute('id'), $file), E_USER_DEPRECATED);
+ }
+ }
+
+ foreach ($alias->childNodes as $child) {
+ if ($child instanceof \DOMElement && $child->namespaceURI === self::NS) {
+ @trigger_error(sprintf('Using the element "%s" is deprecated for the service "%s" which is defined as an alias in "%s". The XmlFileLoader will raise an exception in Symfony 4.0, instead of silently ignoring unsupported elements.', $child->localName, $alias->getAttribute('id'), $file), E_USER_DEPRECATED);
+ }
+ }
+ }
+