1 | <?php |
||
8 | abstract class Creator |
||
9 | { |
||
10 | use Filesystem; |
||
11 | |||
12 | /** |
||
13 | * Yarak config. |
||
14 | * |
||
15 | * @var Config |
||
16 | */ |
||
17 | protected $config; |
||
18 | |||
19 | /** |
||
20 | * Output strategy. |
||
21 | * |
||
22 | * @var Output |
||
23 | */ |
||
24 | protected $output; |
||
25 | |||
26 | /** |
||
27 | * Construct. |
||
28 | * |
||
29 | * @param Config $config |
||
30 | * @param Output $output |
||
31 | */ |
||
32 | public function __construct(Config $config, Output $output) |
||
37 | |||
38 | /** |
||
39 | * Guess a namespace based on a path. |
||
40 | * |
||
41 | * @param string $path |
||
42 | * |
||
43 | * @return string|null |
||
44 | */ |
||
45 | protected function guessNamespace($path) |
||
59 | |||
60 | /** |
||
61 | * Set the namespace in the command stub. |
||
62 | * |
||
63 | * @param string $stub |
||
64 | * @param string $namespace |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function setNamespace($stub, $namespace = null) |
||
80 | |||
81 | /** |
||
82 | * Output nothing created message if no all bools are false. |
||
83 | * |
||
84 | * @param array $bools |
||
85 | */ |
||
86 | protected function outputNothingCreated(array $bools) |
||
98 | } |
||
99 |