blob: 7fed65cd3c9d046d536d5d5a1488f03ddc9287e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<?php
namespace App\Filesystem;
use App\Filesystem\Create;
/**
* Class to create a new file
*
* @param string $filename [description]
* @author Phil Burton <phil@d3r.com>
*/
class CreateFile extends Create
{
/**
* Thing we're creating
*
* @author Phil Burton <phil@d3r.com>
*/
protected $thing = "file";
/**
* Check if the file already exists
*
* @param string $filename
* @author Phil Burton <phil@d3r.com>
*/
public function __construct(string $filename)
{
parent::__construct($filename);
if (file_exists($filename)) {
throw new \Exception('File already exists at: ' . $filename);
}
}
/**
* Create the new file
*
* @author Phil Burton <phil@d3r.com>
*/
public function excecute()
{
echo "execute";
}
}
|