*/ abstract class Create { /** * Filename to create * * @var string * @author Phil Burton */ protected $filename; /** * Thing we're creating, used for messages * * @var string * @author Phil Burton */ protected $thing; /** * Set filename on object and check we can wirte to the Directory * * @param string $filename * @author Phil Burton */ 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(); }