minor #14688 [Routing] clarify deprecation message (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [Routing] clarify deprecation message | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | as reported by @javiereguiluz in7784b29e5a (commitcomment-11229119)
Commits -------8a99645
[Routing] clarify deprecation message
This commit is contained in:
commit
6f8d593b3a
@ -122,7 +122,7 @@ class XmlFileLoader extends FileLoader
|
|||||||
throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error(sprintf('The "pattern" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$node->setAttribute('path', $node->getAttribute('pattern'));
|
$node->setAttribute('path', $node->getAttribute('pattern'));
|
||||||
$node->removeAttribute('pattern');
|
$node->removeAttribute('pattern');
|
||||||
|
@ -81,7 +81,7 @@ class YamlFileLoader extends FileLoader
|
|||||||
throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error(sprintf('The "pattern" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||||
|
|
||||||
$config['path'] = $config['pattern'];
|
$config['path'] = $config['pattern'];
|
||||||
unset($config['pattern']);
|
unset($config['pattern']);
|
||||||
|
Reference in New Issue
Block a user