1 | <?php |
||
11 | abstract class BaseGenerator |
||
12 | { |
||
13 | /** |
||
14 | * @var \Factory\Composer |
||
15 | */ |
||
16 | protected $composer; |
||
17 | /** |
||
18 | * @var Filesystem |
||
19 | */ |
||
20 | private $internal; |
||
21 | /** |
||
22 | * @var Mustache_Engine |
||
23 | */ |
||
24 | private $engine; |
||
25 | /** |
||
26 | * @var \League\Flysystem\Filesystem |
||
27 | */ |
||
28 | protected $external; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $data; |
||
34 | |||
35 | /** |
||
36 | * @param mixed $data |
||
37 | * |
||
38 | * @return static |
||
39 | */ |
||
40 | public function setData($data) |
||
52 | |||
53 | /** |
||
54 | * @var boolean |
||
55 | */ |
||
56 | protected $force = false; |
||
57 | |||
58 | /** |
||
59 | * @param boolean $force |
||
60 | * |
||
61 | * @return static |
||
62 | */ |
||
63 | public function setForce($force = false) |
||
68 | |||
69 | public function __construct(Composer $composer, Filesystem $external = null, Mustache_Engine $engine = null) |
||
76 | |||
77 | public function prepare($template, $data = []) |
||
83 | |||
84 | protected function write($data) |
||
95 | |||
96 | public function generate($stub, $data) |
||
102 | |||
103 | abstract function make(); |
||
104 | } |
||
105 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.