@@ -81,6 +81,9 @@ discard block |
||
| 81 | 81 | return $this->engine->render($template, $data); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** |
|
| 85 | + * @param string $data |
|
| 86 | + */ |
|
| 84 | 87 | protected function write($data) |
| 85 | 88 | { |
| 86 | 89 | $destination = $this->composer->getClassPath($this->data['name']); |
@@ -93,6 +96,9 @@ discard block |
||
| 93 | 96 | return $this->external->write($destination, $data); |
| 94 | 97 | } |
| 95 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $stub |
|
| 101 | + */ |
|
| 96 | 102 | public function generate($stub, $data) |
| 97 | 103 | { |
| 98 | 104 | $template = $this->prepare($stub, array_merge($this->data, $data)); |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Factory\Generators; |
| 4 | 4 | |
| 5 | -use League\Flysystem\Adapter\Local; |
|
| 6 | -use League\Flysystem\Filesystem; |
|
| 7 | 5 | use Factory\Composer; |
| 8 | 6 | use Factory\Utils; |
| 7 | +use League\Flysystem\Adapter\Local; |
|
| 8 | +use League\Flysystem\Filesystem; |
|
| 9 | 9 | use Mustache_Engine; |
| 10 | 10 | |
| 11 | 11 | abstract class BaseGenerator |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Factory\Generators; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Str; |
|
| 6 | 5 | use Factory\Utils; |
| 6 | +use Illuminate\Support\Str; |
|
| 7 | 7 | |
| 8 | 8 | class TestGenerator extends BaseGenerator |
| 9 | 9 | { |