| 1 | <?php |
||
| 9 | abstract class Creator |
||
| 10 | { |
||
| 11 | use Filesystem; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Yarak config. |
||
| 15 | * |
||
| 16 | * @var Config |
||
| 17 | */ |
||
| 18 | protected $config; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Output strategy. |
||
| 22 | * |
||
| 23 | * @var Output |
||
| 24 | */ |
||
| 25 | protected $output; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Construct. |
||
| 29 | * |
||
| 30 | * @param Config $config |
||
| 31 | * @param Output $output |
||
| 32 | */ |
||
| 33 | public function __construct(Config $config, Output $output) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Guess a namespace based on a path. |
||
| 41 | * |
||
| 42 | * @param string $path |
||
| 43 | * |
||
| 44 | * @return string|null |
||
| 45 | */ |
||
| 46 | protected function guessNamespace($path) |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Set the namespace in the command stub. |
||
| 65 | * |
||
| 66 | * @param string $stub |
||
| 67 | * @param string $namespace |
||
| 68 | * |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | protected function setNamespace($stub, $namespace = null) |
||
| 83 | } |
||
| 84 |