diff options
Diffstat (limited to 'src/Filesystem')
-rw-r--r-- | src/Filesystem/CreateDirectory.php | 13 | ||||
-rw-r--r-- | src/Filesystem/CreateFile.php | 17 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/Filesystem/CreateDirectory.php b/src/Filesystem/CreateDirectory.php index 64c5fba..2621169 100644 --- a/src/Filesystem/CreateDirectory.php +++ b/src/Filesystem/CreateDirectory.php @@ -2,21 +2,16 @@ namespace App\Filesystem; +use App\Task\TaskInterface; + /** * Class to create a new directory * * @author Phil Burton <phil@d3r.com> */ -class CreateDirectory +class CreateDirectory implements TaskInterface { /** - * Thing we're creating - * - * @author Phil Burton <phil@d3r.com> - */ - protected $thing = "directory"; - - /** * Directory to create * * @var string @@ -34,7 +29,7 @@ class CreateDirectory $this->directory = $directory; if (!is_writable(dirname($directory))) { - throw new \Exception('Cannot create ' . $this->thing . ' at: ' . $directory); + throw new \Exception('Cannot create directory at: ' . $directory); } if (file_exists($directory)) { diff --git a/src/Filesystem/CreateFile.php b/src/Filesystem/CreateFile.php index 93c66a6..ce9537f 100644 --- a/src/Filesystem/CreateFile.php +++ b/src/Filesystem/CreateFile.php @@ -2,22 +2,27 @@ namespace App\Filesystem; +use App\Task\TaskInterface; + /** * Class to create a new file * * @author Phil Burton <phil@d3r.com> */ -class CreateFile +class CreateFile implements TaskInterface { /** - * Thing we're creating + * Name of file to create * - * @author Phil Burton <phil@d3r.com> + * @var string */ - protected $thing = "file"; - protected $filename; + /** + * File contents to write + * + * @var string + */ protected $contents; /** @@ -35,7 +40,7 @@ class CreateFile } if (!is_writable(dirname($filename))) { - throw new \Exception('Cannot create ' . $this->thing . ' at: ' . $filename); + throw new \Exception('Cannot create file at: ' . $filename); } if (file_exists($filename)) { |