| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class SeedGenerator extends AbstractGenerator |
||
| 10 | { |
||
| 11 | public function __construct(Model $model) |
||
| 12 | { |
||
| 13 | parent::__construct($model); |
||
| 14 | $this->stub = File::get(STUBS_PATH.'/seed.stub'); |
||
| 15 | } |
||
| 16 | |||
| 17 | protected function getPath(): string |
||
| 20 | } |
||
| 21 | |||
| 22 | public function populateStub(): string |
||
| 23 | { |
||
| 24 | $stub = $this->stub; |
||
| 25 | $stub = str_replace('{{Namespace}}', config('generators.model_namespace'), $stub); |
||
| 26 | $stub = str_replace('{{ClassName}}', $this->getClassName(), $stub); |
||
| 27 | $stub = str_replace('{{factoryClass}}', config('generators.model_namespace')."\\{$this->model->name()}", $stub); |
||
| 28 | |||
| 29 | return $stub; |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function getClassName() |
||
| 35 | } |
||
| 36 | } |
||
| 37 |