Rename node factory and walker variables

Prepend variable names with `node` ready for upcoming additional
factory.
This commit is contained in:
adlawson 2015-07-22 16:00:52 +01:00
parent 3bd78d08af
commit 8e8f09c0d2
2 changed files with 26 additions and 26 deletions

View File

@ -17,37 +17,37 @@ use Vfs\Node\Walker\NodeWalkerInterface;
class FileSystem implements FileSystemInterface class FileSystem implements FileSystemInterface
{ {
protected $factory;
protected $registry;
protected $logger; protected $logger;
protected $nodeFactory;
protected $nodeWalker;
protected $registry;
protected $scheme; protected $scheme;
protected $walker;
protected $wrapperClass; protected $wrapperClass;
/** /**
* @param string $scheme * @param string $scheme
* @param string $wrapperClass * @param string $wrapperClass
* @param NodeFactoryInterface $factory * @param NodeFactoryInterface $nodeFactory
* @param NodeWalkerInterface $walker * @param NodeWalkerInterface $nodeWalker
* @param RegistryInterface $registry * @param RegistryInterface $registry
* @param LoggerInterface $logger * @param LoggerInterface $logger
*/ */
public function __construct( public function __construct(
$scheme, $scheme,
$wrapperClass, $wrapperClass,
NodeFactoryInterface $factory, NodeFactoryInterface $nodeFactory,
NodeWalkerInterface $walker, NodeWalkerInterface $nodeWalker,
RegistryInterface $registry, RegistryInterface $registry,
LoggerInterface $logger LoggerInterface $logger
) { ) {
$this->wrapperClass = $wrapperClass; $this->wrapperClass = $wrapperClass;
$this->scheme = rtrim($scheme, ':/\\'); $this->scheme = rtrim($scheme, ':/\\');
$this->walker = $walker; $this->nodeWalker = $nodeWalker;
$this->logger = $logger; $this->logger = $logger;
$this->factory = $factory; $this->nodeFactory = $nodeFactory;
$this->registry = $registry; $this->registry = $registry;
$this->root = $factory->buildDirectory(); $this->root = $nodeFactory->buildDirectory();
} }
/** /**
@ -63,7 +63,7 @@ class FileSystem implements FileSystemInterface
public function get($path) public function get($path)
{ {
return $this->walker->findNode($this->root, $path); return $this->nodeWalker->findNode($this->root, $path);
} }
public function getLogger() public function getLogger()
@ -73,12 +73,12 @@ class FileSystem implements FileSystemInterface
public function getNodeFactory() public function getNodeFactory()
{ {
return $this->factory; return $this->nodeFactory;
} }
public function getNodeWalker() public function getNodeWalker()
{ {
return $this->walker; return $this->nodeWalker;
} }
public function getScheme() public function getScheme()

View File

@ -18,11 +18,11 @@ use Vfs\Node\Walker\NodeWalkerInterface;
class FileSystemBuilder class FileSystemBuilder
{ {
protected $factory;
protected $registry;
protected $logger; protected $logger;
protected $nodeFactory;
protected $nodeWalker;
protected $registry;
protected $scheme; protected $scheme;
protected $walker;
protected $wrapperClass; protected $wrapperClass;
protected $tree = []; protected $tree = [];
@ -49,8 +49,8 @@ class FileSystemBuilder
); );
$root = $fs->get('/'); $root = $fs->get('/');
$factory = $fs->getNodeFactory(); $nodeFactory = $fs->getNodeFactory();
foreach ($factory->buildTree($this->getTree()) as $name => $node) { foreach ($nodeFactory->buildTree($this->getTree()) as $name => $node) {
$root->set($name, $node); $root->set($name, $node);
} }
@ -81,16 +81,16 @@ class FileSystemBuilder
*/ */
public function getNodeFactory() public function getNodeFactory()
{ {
return $this->factory; return $this->nodeFactory;
} }
/** /**
* @param NodeFactoryInterface $factory * @param NodeFactoryInterface $nodeFactory
* @return FileSystemBuilder * @return FileSystemBuilder
*/ */
public function setNodeFactory(NodeFactoryInterface $factory) public function setNodeFactory(NodeFactoryInterface $nodeFactory)
{ {
$this->factory = $factory; $this->nodeFactory = $nodeFactory;
return $this; return $this;
} }
@ -100,16 +100,16 @@ class FileSystemBuilder
*/ */
public function getNodeWalker() public function getNodeWalker()
{ {
return $this->walker; return $this->nodeWalker;
} }
/** /**
* @param NodeWalkerInterface $walker * @param NodeWalkerInterface $nodeWalker
* @return FileSystemBuilder * @return FileSystemBuilder
*/ */
public function setNodeWalker(NodeWalkerInterface $walker) public function setNodeWalker(NodeWalkerInterface $nodeWalker)
{ {
$this->walker = $walker; $this->nodeWalker = $nodeWalker;
return $this; return $this;
} }