From 31ac8bccdae86eeb150cb396c44ee88427120e3e Mon Sep 17 00:00:00 2001 From: Phil Burton Date: Mon, 21 Aug 2017 18:58:05 +0100 Subject: wip --- src/Filesystem/Create.php | 25 +++++++++++++++++++++++++ src/Filesystem/CreateDirectory.php | 22 +++++++++++++++++++++- src/Filesystem/CreateFile.php | 23 ++++++++++++++++++++++- 3 files changed, 68 insertions(+), 2 deletions(-) (limited to 'src/Filesystem') 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 + */ abstract class Create { + /** + * Filename to create + * + * @var string + * @author Phil Burton + */ protected $filename; + + /** + * Thing we're creating, used for messages + * + * @var string + * @author Phil Burton + */ protected $thing; + /** + * Set filename on object and check we can wirte to the Directory + * + * @param string $filename + * @author Phil Burton + */ 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 + */ class CreateDirectory extends Create { - protected $filename; + /** + * Thing we're creating + * + * @author Phil Burton + */ protected $thing = "directory"; + /** + * Check if the directory already exists + * + * @param string $filename + * @author Phil Burton + */ public function __construct(string $filename) { parent::__construct($filename); @@ -18,6 +33,11 @@ class CreateDirectory extends Create } } + /** + * Create the new directory + * + * @author Phil Burton + */ 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 + */ class CreateFile extends Create { - protected $filename; + /** + * Thing we're creating + * + * @author Phil Burton + */ protected $thing = "file"; + /** + * Check if the file already exists + * + * @param string $filename + * @author Phil Burton + */ public function __construct(string $filename) { parent::__construct($filename); @@ -18,6 +34,11 @@ class CreateFile extends Create } } + /** + * Create the new file + * + * @author Phil Burton + */ public function excecute() { echo "execute"; -- cgit v1.2.3