merged branch francisbesset/routing_constant_usage (PR #6449)

This PR was merged into the master branch.

Commits
-------

18daa10 [Routing] Used static to call constant in XmlFileLoader

Discussion
----------

[2.2][Routing] Used static to call constant in XmlFileLoader

It is more complicated to override XmlFileLoader if contants are called with `self`.
This PR replace `self` to `static`.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

---------------------------------------------------------------------------

by piotrpasich at 2012-12-21T08:17:14Z

+1
This commit is contained in:
Fabien Potencier 2012-12-27 16:08:42 +01:00
commit c0e341c618

View File

@ -76,7 +76,7 @@ class XmlFileLoader extends FileLoader
*/
protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file)
{
if (self::NAMESPACE_URI !== $node->namespaceURI) {
if (static::NAMESPACE_URI !== $node->namespaceURI) {
return;
}
@ -192,7 +192,7 @@ class XmlFileLoader extends FileLoader
$requirements = array();
$options = array();
foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) {
foreach ($node->getElementsByTagNameNS(static::NAMESPACE_URI, '*') as $n) {
switch ($n->localName) {
case 'default':
$defaults[$n->getAttribute('key')] = trim($n->textContent);