فهرست منبع

[Config] moved from protected to private (WIP)

Fabien Potencier 14 سال پیش
والد
کامیت
e4a3e0c2c7

+ 2 - 2
src/Symfony/Component/Config/ConfigCache.php

@@ -21,8 +21,8 @@ namespace Symfony\Component\Config;
  */
 class ConfigCache
 {
-    protected $debug;
-    protected $file;
+    private $debug;
+    private $file;
 
     /**
      * Constructor.

+ 1 - 1
src/Symfony/Component/Config/FileLocator.php

@@ -85,7 +85,7 @@ class FileLocator implements FileLocatorInterface
      *
      * @return Boolean
      */
-    protected function isAbsolutePath($file)
+    private function isAbsolutePath($file)
     {
         if ($file[0] == '/' || $file[0] == '\\'
             || (strlen($file) > 3 && ctype_alpha($file[0])

+ 7 - 1
src/Symfony/Component/Config/Loader/FileLoader.php

@@ -21,7 +21,8 @@ use Symfony\Component\Config\FileLocatorInterface;
 abstract class FileLoader extends Loader
 {
     protected $locator;
-    protected $currentDir;
+
+    private $currentDir;
 
     /**
      * Constructor.
@@ -31,6 +32,11 @@ abstract class FileLoader extends Loader
         $this->locator = $locator;
     }
 
+    public function setCurrentDir($dir)
+    {
+        $this->currentDir = $dir;
+    }
+
     public function getLocator()
     {
         return $this->locator;

+ 1 - 1
src/Symfony/Component/Config/Loader/LoaderResolver.php

@@ -24,7 +24,7 @@ class LoaderResolver implements LoaderResolverInterface
     /**
      * @var LoaderInterface[] An array of LoaderInterface objects
      */
-    protected $loaders;
+    private $loaders;
 
     /**
      * Constructor.

+ 2 - 2
src/Symfony/Component/Config/Resource/DirectoryResource.php

@@ -18,8 +18,8 @@ namespace Symfony\Component\Config\Resource;
  */
 class DirectoryResource implements ResourceInterface
 {
-    protected $resource;
-    protected $filterRegexList;
+    private $resource;
+    private $filterRegexList;
 
     /**
      * Constructor.

+ 1 - 1
src/Symfony/Component/Config/Resource/FileResource.php

@@ -18,7 +18,7 @@ namespace Symfony\Component\Config\Resource;
  */
 class FileResource implements ResourceInterface
 {
-    protected $resource;
+    private $resource;
 
     /**
      * Constructor.

+ 1 - 1
src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php

@@ -36,7 +36,7 @@ class PhpFileLoader extends FileLoader
         $loader = $this;
 
         $path = $this->locator->locate($file);
-        $this->currentDir = dirname($path);
+        $this->setCurrentDir(dirname($path));
         $this->container->addResource(new FileResource($path));
 
         include $path;

+ 1 - 1
src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

@@ -106,7 +106,7 @@ class XmlFileLoader extends FileLoader
         }
 
         foreach ($imports as $import) {
-            $this->currentDir = dirname($file);
+            $this->setCurrentDir(dirname($file));
             $this->import((string) $import['resource'], (Boolean) $import->getAttributeAsPhp('ignore-errors'));
         }
     }

+ 1 - 1
src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

@@ -96,7 +96,7 @@ class YamlFileLoader extends FileLoader
         }
 
         foreach ($content['imports'] as $import) {
-            $this->currentDir = dirname($file);
+            $this->setCurrentDir(dirname($file));
             $this->import($import['resource'], isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false);
         }
     }

+ 1 - 1
src/Symfony/Component/Routing/Loader/PhpFileLoader.php

@@ -37,7 +37,7 @@ class PhpFileLoader extends FileLoader
         $path = $this->locator->locate($file);
 
         $collection = include $path;
-        $this->currentDir = dirname($path);
+        $this->setCurrentDir(dirname($path));
         $collection->addResource(new FileResource($path));
 
         return $collection;

+ 1 - 1
src/Symfony/Component/Routing/Loader/XmlFileLoader.php

@@ -56,7 +56,7 @@ class XmlFileLoader extends FileLoader
                     $resource = (string) $node->getAttribute('resource');
                     $type = (string) $node->getAttribute('type');
                     $prefix = (string) $node->getAttribute('prefix');
-                    $this->currentDir = dirname($path);
+                    $this->setCurrentDir(dirname($path));
                     $collection->addCollection($this->import($resource, ('' !== $type ? $type : null)), $prefix);
                     break;
                 default:

+ 1 - 1
src/Symfony/Component/Routing/Loader/YamlFileLoader.php

@@ -63,7 +63,7 @@ class YamlFileLoader extends FileLoader
             if (isset($config['resource'])) {
                 $type = isset($config['type']) ? $config['type'] : null;
                 $prefix = isset($config['prefix']) ? $config['prefix'] : null;
-                $this->currentDir = dirname($path);
+                $this->setCurrentDir(dirname($path));
                 $collection->addCollection($this->import($config['resource'], $type), $prefix);
             } elseif (isset($config['pattern'])) {
                 $this->parseRoute($collection, $name, $config, $path);