Skip to content

Commit

Permalink
Reuse has method in FilesystemMap
Browse files Browse the repository at this point in the history
  • Loading branch information
akovalyov committed Feb 4, 2016
1 parent 07a46cc commit cee7dbf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions FilesystemMap.php
Expand Up @@ -4,25 +4,25 @@

/**
* Holds references to all declared filesystems
* and allows to access them through their name
* and allows to access them through their name.
*/
class FilesystemMap implements \IteratorAggregate
{
/**
* Map of filesystems indexed by their name
* Map of filesystems indexed by their name.
*
* @var array
*/
protected $map;
protected $maps;

/**
* Instantiates a new filesystem map
* Instantiates a new filesystem map.
*
* @param array $map
* @param array $maps
*/
public function __construct(array $map)
public function __construct(array $maps)
{
$this->map = $map;
$this->maps = $maps;
}

/**
Expand All @@ -36,11 +36,11 @@ public function __construct(array $map)
*/
public function get($name)
{
if (!isset($this->map[$name])) {
throw new \InvalidArgumentException(sprintf('No filesystem register for name "%s"', $name));
if (!$this->has($name)) {
throw new \InvalidArgumentException(sprintf('No filesystem is registered for name "%s"', $name));
}

return $this->map[$name];
return $this->maps[$name];
}

/**
Expand All @@ -50,11 +50,11 @@ public function get($name)
*/
public function has($name)
{
return isset($this->map[$name]);
return isset($this->maps[$name]);
}

public function getIterator()
{
return new \ArrayIterator($this->map);
return new \ArrayIterator($this->maps);
}
}

0 comments on commit cee7dbf

Please sign in to comment.