Skip to content

Commit b585752

Browse files
committed
[Routing] moved protected to private
1 parent 9595963 commit b585752

21 files changed

+88
-87
lines changed

src/Symfony/Component/Routing/Annotation/Route.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
*/
1919
class Route
2020
{
21-
protected $pattern;
22-
protected $name;
23-
protected $requirements;
24-
protected $options;
25-
protected $defaults;
21+
private $pattern;
22+
private $name;
23+
private $requirements;
24+
private $options;
25+
private $defaults;
2626

2727
/**
2828
* Constructor.

src/Symfony/Component/Routing/Annotation/Routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class Routes
2020
{
21-
protected $routes;
21+
private $routes;
2222

2323
/**
2424
* Constructor.

src/Symfony/Component/Routing/CompiledRoute.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
*/
1919
class CompiledRoute
2020
{
21-
protected $route;
22-
protected $variables;
23-
protected $tokens;
24-
protected $staticPrefix;
25-
protected $regex;
21+
private $route;
22+
private $variables;
23+
private $tokens;
24+
private $staticPrefix;
25+
private $regex;
2626

2727
/**
2828
* Constructor.

src/Symfony/Component/Routing/Generator/Dumper/GeneratorDumper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
abstract class GeneratorDumper implements GeneratorDumperInterface
2323
{
24-
protected $routes;
24+
private $routes;
2525

2626
/**
2727
* Constructor.
@@ -32,4 +32,9 @@ public function __construct(RouteCollection $routes)
3232
{
3333
$this->routes = $routes;
3434
}
35+
36+
public function getRoutes()
37+
{
38+
return $this->routes;
39+
}
3540
}

src/Symfony/Component/Routing/Generator/Dumper/GeneratorDumperInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Routing\Generator\Dumper;
1313

14+
use Symfony\Component\Routing\RouteCollection;
15+
1416
/**
1517
* GeneratorDumperInterface is the interface that all generator dumper classes must implement.
1618
*
@@ -31,4 +33,11 @@ interface GeneratorDumperInterface
3133
* @return string A PHP class representing the generator class
3234
*/
3335
function dump(array $options = array());
36+
37+
/**
38+
* Gets the routes to dump.
39+
*
40+
* @return RouteCollection A RouteCollection instance
41+
*/
42+
function getRoutes();
3443
}

src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public function dump(array $options = array())
4747
;
4848
}
4949

50-
protected function addGenerator()
50+
private function addGenerator()
5151
{
5252
$methods = array();
53-
foreach ($this->routes->all() as $name => $route) {
53+
foreach ($this->getRoutes()->all() as $name => $route) {
5454
$compiledRoute = $route->compile();
5555

5656
$variables = str_replace("\n", '', var_export($compiledRoute->getVariables(), true));
@@ -64,7 +64,7 @@ protected function addGenerator()
6464
$escapedName = str_replace('.', '__', $name);
6565

6666
$methods[] = <<<EOF
67-
protected function get{$escapedName}RouteInfo()
67+
private function get{$escapedName}RouteInfo()
6868
{
6969
\$defaults = \$this->defaults;
7070
$defaultsMerge
@@ -96,10 +96,10 @@ public function generate(\$name, array \$parameters, \$absolute = false)
9696
EOF;
9797
}
9898

99-
protected function startClass($class, $baseClass)
99+
private function startClass($class, $baseClass)
100100
{
101101
$routes = array();
102-
foreach ($this->routes->all() as $name => $route) {
102+
foreach ($this->getRoutes()->all() as $name => $route) {
103103
$routes[] = " '$name' => true,";
104104
}
105105
$routes = implode("\n", $routes);
@@ -115,15 +115,15 @@ protected function startClass($class, $baseClass)
115115
*/
116116
class $class extends $baseClass
117117
{
118-
static protected \$declaredRouteNames = array(
118+
static private \$declaredRouteNames = array(
119119
$routes
120120
);
121121
122122
123123
EOF;
124124
}
125125

126-
protected function addConstructor()
126+
private function addConstructor()
127127
{
128128
return <<<EOF
129129
/**
@@ -138,7 +138,7 @@ public function __construct(array \$context = array(), array \$defaults = array(
138138
EOF;
139139
}
140140

141-
protected function endClass()
141+
private function endClass()
142142
{
143143
return <<<EOF
144144
}

src/Symfony/Component/Routing/Generator/UrlGenerator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
*/
2222
class UrlGenerator implements UrlGeneratorInterface
2323
{
24-
protected $routes;
2524
protected $defaults;
2625
protected $context;
27-
protected $cache;
26+
27+
private $routes;
28+
private $cache;
2829

2930
/**
3031
* Constructor.

src/Symfony/Component/Routing/Loader/AnnotationFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
class AnnotationFileLoader extends FileLoader
2626
{
27-
protected $loader;
27+
private $loader;
2828

2929
/**
3030
* Constructor.
@@ -86,7 +86,7 @@ public function supports($resource, $type = null)
8686
*
8787
* @return string|false Full class name if found, false otherwise
8888
*/
89-
protected function findClass($file)
89+
private function findClass($file)
9090
{
9191
$class = false;
9292
$namespace = false;

src/Symfony/Component/Routing/Loader/AnnotationGlobLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function supports($resource, $type = null)
6262
*
6363
* @return array An array of paths matching the glob pattern
6464
*/
65-
protected function getAbsolutePaths($glob)
65+
private function getAbsolutePaths($glob)
6666
{
6767
$dirs = array();
6868
foreach ($this->paths as $path) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ protected function validate(\DOMDocument $dom)
167167
*
168168
* @return array An array of libxml error strings
169169
*/
170-
protected function getXmlErrors()
170+
private function getXmlErrors()
171171
{
172172
$errors = array();
173173
foreach (libxml_get_errors() as $error) {

0 commit comments

Comments
 (0)