From 723bc6afd14a1fce99f6b5fde70b575279f95d69 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 22 Aug 2016 18:08:57 +0200 Subject: [PATCH] Fixing interface implementations --- System/File/ContainerInterface.php | 3 +- System/File/Ftp/FtpStorage.php | 303 +++++++++++++++++++++++++++++ System/File/Local/Directory.php | 3 +- System/File/Local/File.php | 3 +- System/File/Local/FileAbstract.php | 1 + System/File/Local/LocalStorage.php | 3 +- 6 files changed, 311 insertions(+), 5 deletions(-) diff --git a/System/File/ContainerInterface.php b/System/File/ContainerInterface.php index 1ba1d1ca9..ca92cafd5 100644 --- a/System/File/ContainerInterface.php +++ b/System/File/ContainerInterface.php @@ -14,6 +14,7 @@ * @link http://orange-management.com */ namespace phpOMS\System\File; +use phpOMS\System\File\Local\FileAbstract; /** * Filesystem class. @@ -60,7 +61,7 @@ interface ContainerInterface public function getPath() : string; - public function getParent() : FileInterface; + public function getParent() : ContainerInterface; public function createNode() : bool; diff --git a/System/File/Ftp/FtpStorage.php b/System/File/Ftp/FtpStorage.php index e69de29bb..b27836860 100644 --- a/System/File/Ftp/FtpStorage.php +++ b/System/File/Ftp/FtpStorage.php @@ -0,0 +1,303 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace phpOMS\System\File\Ftp; +use phpOMS\System\File\ContainerInterface; +use phpOMS\System\File\StorageAbstract; + +/** + * Filesystem class. + * + * Performing operations on the file system + * + * @category Framework + * @package phpOMS\System\File + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class FtpStorage extends StorageAbstract +{ + + public static function created(string $path) : \DateTime + { + // TODO: Implement created() method. + } + + public static function changed(string $path) : \DateTime + { + // TODO: Implement changed() method. + } + + public static function owner(string $path) : int + { + // TODO: Implement owner() method. + } + + public static function permission(string $path) : int + { + // TODO: Implement permission() method. + } + + public static function parent(string $path) : string + { + // TODO: Implement parent() method. + } + + public static function create(string $path) : bool + { + // TODO: Implement create() method. + } + + public static function delete(string $path) : bool + { + // TODO: Implement delete() method. + } + + public static function copy(string $from, string $to, bool $overwrite = false) : bool + { + // TODO: Implement copy() method. + } + + public static function move(string $from, string $to, bool $overwrite = false) : bool + { + // TODO: Implement move() method. + } + + public static function size(string $path) : int + { + // TODO: Implement size() method. + } + + public static function exists(string $path) : bool + { + // TODO: Implement exists() method. + } + + public function getCount() : int + { + // TODO: Implement getCount() method. + } + + public function getSize() : int + { + // TODO: Implement getSize() method. + } + + public function getName() : string + { + // TODO: Implement getName() method. + } + + public function getPath() : string + { + // TODO: Implement getPath() method. + } + + public function getParent() : ContainerInterface + { + // TODO: Implement getParent() method. + } + + public function createNode() : bool + { + // TODO: Implement createNode() method. + } + + public function copyNode() : bool + { + // TODO: Implement copyNode() method. + } + + public function moveNode() : bool + { + // TODO: Implement moveNode() method. + } + + public function deleteNode() : bool + { + // TODO: Implement deleteNode() method. + } + + public function getCreatedAt() : \DateTime + { + // TODO: Implement getCreatedAt() method. + } + + public function getChangedAt() : \DateTime + { + // TODO: Implement getChangedAt() method. + } + + public function getOwner() : int + { + // TODO: Implement getOwner() method. + } + + public function getPermission() : string + { + // TODO: Implement getPermission() method. + } + + public function index() + { + // TODO: Implement index() method. + } + + /** + * Return the current element + * @link http://php.net/manual/en/iterator.current.php + * @return mixed Can return any type. + * @since 5.0.0 + */ + public function current() + { + // TODO: Implement current() method. + } + + /** + * Move forward to next element + * @link http://php.net/manual/en/iterator.next.php + * @return void Any returned value is ignored. + * @since 5.0.0 + */ + public function next() + { + // TODO: Implement next() method. + } + + /** + * Return the key of the current element + * @link http://php.net/manual/en/iterator.key.php + * @return mixed scalar on success, or null on failure. + * @since 5.0.0 + */ + public function key() + { + // TODO: Implement key() method. + } + + /** + * Checks if current position is valid + * @link http://php.net/manual/en/iterator.valid.php + * @return boolean The return value will be casted to boolean and then evaluated. + * Returns true on success or false on failure. + * @since 5.0.0 + */ + public function valid() + { + // TODO: Implement valid() method. + } + + /** + * Rewind the Iterator to the first element + * @link http://php.net/manual/en/iterator.rewind.php + * @return void Any returned value is ignored. + * @since 5.0.0 + */ + public function rewind() + { + // TODO: Implement rewind() method. + } + + /** + * Whether a offset exists + * @link http://php.net/manual/en/arrayaccess.offsetexists.php + * @param mixed $offset

+ * An offset to check for. + *

+ * @return boolean true on success or false on failure. + *

+ *

+ * The return value will be casted to boolean if non-boolean was returned. + * @since 5.0.0 + */ + public function offsetExists($offset) + { + // TODO: Implement offsetExists() method. + } + + /** + * Offset to retrieve + * @link http://php.net/manual/en/arrayaccess.offsetget.php + * @param mixed $offset

+ * The offset to retrieve. + *

+ * @return mixed Can return all value types. + * @since 5.0.0 + */ + public function offsetGet($offset) + { + // TODO: Implement offsetGet() method. + } + + /** + * Offset to set + * @link http://php.net/manual/en/arrayaccess.offsetset.php + * @param mixed $offset

+ * The offset to assign the value to. + *

+ * @param mixed $value

+ * The value to set. + *

+ * @return void + * @since 5.0.0 + */ + public function offsetSet($offset, $value) + { + // TODO: Implement offsetSet() method. + } + + /** + * Offset to unset + * @link http://php.net/manual/en/arrayaccess.offsetunset.php + * @param mixed $offset

+ * The offset to unset. + *

+ * @return void + * @since 5.0.0 + */ + public function offsetUnset($offset) + { + // TODO: Implement offsetUnset() method. + } + + public static function put(string $path, string $content, bool $overwrite = true) : bool + { + // TODO: Implement put() method. + } + + public static function get(string $path) : string + { + // TODO: Implement get() method. + } + + public function putContent() : bool + { + // TODO: Implement putContent() method. + } + + public function getContent() : string + { + // TODO: Implement getContent() method. + } + + protected function getType() : ContainerInterface + { + // TODO: Implement getType() method. + } +} \ No newline at end of file diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index 8d0c2d6eb..dd032574f 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -15,6 +15,7 @@ */ namespace phpOMS\System\File\Local; +use phpOMS\System\File\ContainerInterface; use phpOMS\System\File\DirectoryInterface; use phpOMS\System\File\PathException; use phpOMS\Utils\StringUtils; @@ -441,7 +442,7 @@ class Directory extends FileAbstract implements DirectoryInterface return $this->nodes[$offset] ?? null; } - public function getParent() : FileInterface + public function getParent() : ContainerInterface { // TODO: Implement getParent() method. } diff --git a/System/File/Local/File.php b/System/File/Local/File.php index e52f628bd..e9b09bdfa 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -14,6 +14,7 @@ * @link http://orange-management.com */ namespace phpOMS\System\File\Local; +use phpOMS\System\File\ContainerInterface; use phpOMS\System\File\FileInterface; use phpOMS\System\File\PathException; @@ -361,7 +362,7 @@ class File extends FileAbstract implements FileInterface return $extension[1] ?? ''; } - public function getParent() : FileInterface + public function getParent() : ContainerInterface { // TODO: Implement getParent() method. } diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 84ac380a9..1360fbc57 100644 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -14,6 +14,7 @@ * @link http://orange-management.com */ namespace phpOMS\System\File\Local; +use phpOMS\System\File\ContainerInterface; /** * Filesystem class. diff --git a/System/File/Local/LocalStorage.php b/System/File/Local/LocalStorage.php index cbc9a10cb..8c4d0ccce 100644 --- a/System/File/Local/LocalStorage.php +++ b/System/File/Local/LocalStorage.php @@ -16,7 +16,6 @@ namespace phpOMS\System\File\Local; use phpOMS\System\File\ContainerInterface; use phpOMS\System\File\FileInterface; -use phpOMS\System\File\PathException; use phpOMS\System\File\StorageAbstract; /** @@ -110,7 +109,7 @@ class LocalStorage extends StorageAbstract // TODO: Implement getPath() method. } - public function getParent() : FileInterface + public function getParent() : ContainerInterface { // TODO: Implement getParent() method. }