diff options
author | Fbenas <philbeansburton@gmail.com> | 2017-09-02 20:30:30 +0100 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2017-09-02 20:30:30 +0100 |
commit | 7d2128f364c0e81a15653db2508d3e09b262eca1 (patch) | |
tree | 654ed84f42059aa4fd85e93c96db2824da7f06cb /src/Filesystem/CreateFile.php | |
parent | e237e378a0bfc6e906d7cf682fc7f7fd4af74528 (diff) |
Refactor site:create command to allow creation of extra tasks easier
Diffstat (limited to 'src/Filesystem/CreateFile.php')
-rw-r--r-- | src/Filesystem/CreateFile.php | 17 |
1 files changed, 11 insertions, 6 deletions
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)) { |