@@ -38,7 +38,8 @@ public function dump(array $options = array())
38
38
'base_class ' => 'Symfony \\Component \\Routing \\Generator \\UrlGenerator ' ,
39
39
), $ options );
40
40
41
- return <<<EOF
41
+ if (PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 ) {
42
+ return <<<EOF
42
43
<?php
43
44
44
45
use Symfony\Component\Routing\RequestContext;
@@ -53,7 +54,7 @@ public function dump(array $options = array())
53
54
*/
54
55
class {$ options ['class ' ]} extends {$ options ['base_class ' ]}
55
56
{
56
- private static \$declaredRoutes = { $ this -> generateDeclaredRoutes ()} ;
57
+ private static \$declaredRoutes;
57
58
58
59
/**
59
60
* Constructor.
@@ -62,11 +63,44 @@ public function __construct(RequestContext \$context, LoggerInterface \$logger =
62
63
{
63
64
\$this->context = \$context;
64
65
\$this->logger = \$logger;
66
+ self:: \$declaredRoutes = {$ this ->generateDeclaredRoutes ()};
65
67
}
66
68
67
69
{$ this ->generateGenerateMethod ()}
68
70
}
69
71
72
+ EOF ;
73
+ }
74
+
75
+ return <<<EOF
76
+ <?php
77
+
78
+ use Symfony\Component\Routing\RequestContext;
79
+ use Symfony\Component\Routing\Exception\RouteNotFoundException;
80
+ use Psr\Log\LoggerInterface;
81
+
82
+ /**
83
+ * {$ options ['class ' ]}
84
+ *
85
+ * This class has been auto-generated
86
+ * by the Symfony Routing Component.
87
+ */
88
+ class {$ options ['class ' ]} extends {$ options ['base_class ' ]}
89
+ {
90
+ private static \$declaredRoutes = {$ this ->generateDeclaredRoutes ()};;
91
+
92
+ /**
93
+ * Constructor.
94
+ */
95
+ public function __construct(RequestContext \$context, LoggerInterface \$logger = null)
96
+ {
97
+ \$this->context = \$context;
98
+ \$this->logger = \$logger;
99
+ }
100
+
101
+ {$ this ->generateGenerateMethod ()}
102
+ }
103
+
70
104
EOF ;
71
105
}
72
106
0 commit comments