summaryrefslogtreecommitdiff
path: root/src/Filesystem/CreateDirectory.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2018-02-18 22:29:36 +0000
committerFbenas <philbeansburton@gmail.com>2018-02-18 22:29:36 +0000
commit62146c4027e48cfbdb4f518de137de8430392e24 (patch)
tree791efd0bdccf4f23302428539a0fdc1047502646 /src/Filesystem/CreateDirectory.php
parent7d2128f364c0e81a15653db2508d3e09b262eca1 (diff)
Split client and manager
Diffstat (limited to 'src/Filesystem/CreateDirectory.php')
-rw-r--r--src/Filesystem/CreateDirectory.php49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/Filesystem/CreateDirectory.php b/src/Filesystem/CreateDirectory.php
deleted file mode 100644
index 2621169..0000000
--- a/src/Filesystem/CreateDirectory.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-namespace App\Filesystem;
-
-use App\Task\TaskInterface;
-
-/**
- * Class to create a new directory
- *
- * @author Phil Burton <phil@d3r.com>
- */
-class CreateDirectory implements TaskInterface
-{
- /**
- * Directory to create
- *
- * @var string
- */
- protected $directory;
-
- /**
- * Check if the directory already exists
- *
- * @param string $filename
- * @author Phil Burton <phil@d3r.com>
- */
- public function __construct(string $directory)
- {
- $this->directory = $directory;
-
- if (!is_writable(dirname($directory))) {
- throw new \Exception('Cannot create directory at: ' . $directory);
- }
-
- if (file_exists($directory)) {
- throw new \Exception('Directory already exists at: ' . $directory);
- }
- }
-
- /**
- * Create the new directory
- *
- * @author Phil Burton <phil@d3r.com>
- */
- public function execute()
- {
- mkdir($this->directory);
- }
-}