1 | <?php |
||
8 | class FileGenerator extends Generator |
||
9 | { |
||
10 | /** |
||
11 | * The path wil be used. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $path; |
||
16 | |||
17 | /** |
||
18 | * The contens will be used. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $contents; |
||
23 | |||
24 | /** |
||
25 | * The laravel filesystem or null. |
||
26 | * |
||
27 | * @var \Illuminate\Filesystem\Filesystem|null |
||
28 | */ |
||
29 | protected $filesystem; |
||
30 | |||
31 | /** |
||
32 | * The constructor. |
||
33 | * |
||
34 | * @param $path |
||
35 | * @param $contents |
||
36 | * @param null $filesystem |
||
37 | */ |
||
38 | 53 | public function __construct($path, $contents, $filesystem = null) |
|
44 | |||
45 | /** |
||
46 | * Get contents. |
||
47 | * |
||
48 | * @return mixed |
||
49 | */ |
||
50 | 53 | public function getContents() |
|
54 | |||
55 | /** |
||
56 | * Set contents. |
||
57 | * |
||
58 | * @param mixed $contents |
||
59 | * |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setContents($contents) |
||
68 | |||
69 | /** |
||
70 | * Get filesystem. |
||
71 | * |
||
72 | * @return mixed |
||
73 | */ |
||
74 | public function getFilesystem() |
||
78 | |||
79 | /** |
||
80 | * Set filesystem. |
||
81 | * |
||
82 | * @param Filesystem $filesystem |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function setFilesystem(Filesystem $filesystem) |
||
92 | |||
93 | /** |
||
94 | * Get path. |
||
95 | * |
||
96 | * @return mixed |
||
97 | */ |
||
98 | 53 | public function getPath() |
|
102 | |||
103 | /** |
||
104 | * Set path. |
||
105 | * |
||
106 | * @param mixed $path |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function setPath($path) |
||
116 | |||
117 | /** |
||
118 | * Generate the file. |
||
119 | */ |
||
120 | 53 | public function generate() |
|
128 | } |
||
129 |