Naming fix

This commit is contained in:
Dennis Eichhorn 2016-10-25 20:42:19 +02:00
parent 808e3e4288
commit a9bb3ae75c
3 changed files with 7 additions and 5 deletions

View File

@ -68,5 +68,5 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function add($file) : bool;
public function addNode($file) : bool;
}

View File

@ -81,7 +81,7 @@ class Directory extends FileAbstract implements DirectoryInterface
if (!StringUtils::endsWith(trim($filename), '.')) {
$file = is_dir($filename) ? new self($filename) : new File($filename);
$this->add($file);
$this->addNode($file);
}
}
}
@ -89,7 +89,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/**
* {@inheritdoc}
*/
public function add($file) : bool
public function addNode($file) : bool
{
$this->count += $file->getCount();
$this->size += $file->getSize();
@ -260,6 +260,8 @@ class Directory extends FileAbstract implements DirectoryInterface
public function createNode() : bool
{
return self::create($this->path, $this->permission, true);
// todo: add node
}
/**
@ -343,7 +345,7 @@ class Directory extends FileAbstract implements DirectoryInterface
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->add($value);
$this->addNode($value);
} else {
$this->nodes[$offset] = $value;
}

View File

@ -66,7 +66,7 @@ class File extends FileAbstract implements FileInterface
/**
* {@inheritdoc}
*/
public static function put(string $path, string $content, int $mode = ContentPutMode::APPEND | ContentPutMode::CREATE) : bool
public static function put(string $path, string $content, int $mode = ContentPutMode::REPLACE | ContentPutMode::CREATE) : bool
{
// todo: create all else cases, right now all getting handled the same way which is wrong
if (