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

View File

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