diff --git a/System/File/DirectoryInterface.php b/System/File/DirectoryInterface.php index 09f5c21a7..c6c09cbdf 100644 --- a/System/File/DirectoryInterface.php +++ b/System/File/DirectoryInterface.php @@ -68,5 +68,5 @@ interface DirectoryInterface extends ContainerInterface, \Iterator, \ArrayAccess * @since 1.0.0 * @author Dennis Eichhorn */ - public function add($file) : bool; + public function addNode($file) : bool; } diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index 7a07e61ca..2ef75b9ee 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -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; } diff --git a/System/File/Local/File.php b/System/File/Local/File.php index 3e4fb4a31..6b9b893f2 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -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 (