summaryrefslogtreecommitdiff
path: root/src/Filesystem/Create.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Filesystem/Create.php')
-rw-r--r--src/Filesystem/Create.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Filesystem/Create.php b/src/Filesystem/Create.php
new file mode 100644
index 0000000..a1891db
--- /dev/null
+++ b/src/Filesystem/Create.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Filesystem;
+
+abstract class Create
+{
+ protected $filename;
+ protected $thing;
+
+ public function __construct(string $filename)
+ {
+ $this->filename = $filename;
+
+ if (!is_writable(dirname($filename))) {
+ throw new \Exception('Cannot create ' . $this->thing . ' at: ' . $filename);
+ }
+ }
+
+ abstract public function excecute();
+}