diff options
Diffstat (limited to 'src/Filesystem')
-rw-r--r-- | src/Filesystem/Create.php | 25 | ||||
-rw-r--r-- | src/Filesystem/CreateDirectory.php | 22 | ||||
-rw-r--r-- | src/Filesystem/CreateFile.php | 23 |
3 files changed, 68 insertions, 2 deletions
diff --git a/src/Filesystem/Create.php b/src/Filesystem/Create.php index a1891db..45b09fd 100644 --- a/src/Filesystem/Create.php +++ b/src/Filesystem/Create.php @@ -2,11 +2,36 @@ namespace App\Filesystem; + +/** + * Base class for creating filesystem things + * + * @author Phil Burton <phil@d3r.com> + */ abstract class Create { + /** + * Filename to create + * + * @var string + * @author Phil Burton <phil@d3r.com> + */ protected $filename; + + /** + * Thing we're creating, used for messages + * + * @var string + * @author Phil Burton <phil@d3r.com> + */ protected $thing; + /** + * Set filename on object and check we can wirte to the Directory + * + * @param string $filename + * @author Phil Burton <phil@d3r.com> + */ public function __construct(string $filename) { $this->filename = $filename; diff --git a/src/Filesystem/CreateDirectory.php b/src/Filesystem/CreateDirectory.php index 0c45c6c..2af53d7 100644 --- a/src/Filesystem/CreateDirectory.php +++ b/src/Filesystem/CreateDirectory.php @@ -4,11 +4,26 @@ namespace App\Filesystem; use App\Filesystem\Create; +/** + * Class to create a new directory + * + * @author Phil Burton <phil@d3r.com> + */ class CreateDirectory extends Create { - protected $filename; + /** + * Thing we're creating + * + * @author Phil Burton <phil@d3r.com> + */ protected $thing = "directory"; + /** + * Check if the directory already exists + * + * @param string $filename + * @author Phil Burton <phil@d3r.com> + */ public function __construct(string $filename) { parent::__construct($filename); @@ -18,6 +33,11 @@ class CreateDirectory extends Create } } + /** + * Create the new directory + * + * @author Phil Burton <phil@d3r.com> + */ public function excecute() { echo "execute"; diff --git a/src/Filesystem/CreateFile.php b/src/Filesystem/CreateFile.php index f41d4b9..7fed65c 100644 --- a/src/Filesystem/CreateFile.php +++ b/src/Filesystem/CreateFile.php @@ -4,11 +4,27 @@ namespace App\Filesystem; use App\Filesystem\Create; +/** + * Class to create a new file + * + * @param string $filename [description] + * @author Phil Burton <phil@d3r.com> + */ class CreateFile extends Create { - protected $filename; + /** + * Thing we're creating + * + * @author Phil Burton <phil@d3r.com> + */ protected $thing = "file"; + /** + * Check if the file already exists + * + * @param string $filename + * @author Phil Burton <phil@d3r.com> + */ public function __construct(string $filename) { parent::__construct($filename); @@ -18,6 +34,11 @@ class CreateFile extends Create } } + /** + * Create the new file + * + * @author Phil Burton <phil@d3r.com> + */ public function excecute() { echo "execute"; |