From 7d2128f364c0e81a15653db2508d3e09b262eca1 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sat, 2 Sep 2017 20:30:30 +0100 Subject: Refactor site:create command to allow creation of extra tasks easier --- src/Filesystem/CreateFile.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/Filesystem/CreateFile.php') 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 */ -class CreateFile +class CreateFile implements TaskInterface { /** - * Thing we're creating + * Name of file to create * - * @author Phil Burton + * @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)) { -- cgit v1.2.3