Skip to content

Commit ef82b5b

Browse files
committed
Leverage config merging to default generators
1 parent c4d1126 commit ef82b5b

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

src/Blueprint.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,6 @@ class Blueprint
1111
{
1212
private $lexers = [];
1313
private $generators = [];
14-
private $defaultGenerators = [
15-
'controller' => \Blueprint\Generators\ControllerGenerator::class,
16-
'factory' => \Blueprint\Generators\FactoryGenerator::class,
17-
'migration' => \Blueprint\Generators\MigrationGenerator::class,
18-
'model' => \Blueprint\Generators\ModelGenerator::class,
19-
'route' => \Blueprint\Generators\RouteGenerator::class,
20-
'seeder' => \Blueprint\Generators\SeederGenerator::class,
21-
'test' => \Blueprint\Generators\TestGenerator::class,
22-
'event' => \Blueprint\Generators\Statements\EventGenerator::class,
23-
'form_request' => \Blueprint\Generators\Statements\FormRequestGenerator::class,
24-
'job' => \Blueprint\Generators\Statements\JobGenerator::class,
25-
'mail' => \Blueprint\Generators\Statements\MailGenerator::class,
26-
'notification' => \Blueprint\Generators\Statements\NotificationGenerator::class,
27-
'resource' => \Blueprint\Generators\Statements\ResourceGenerator::class,
28-
'view' => \Blueprint\Generators\Statements\ViewGenerator::class,
29-
];
3014

3115
public static function relativeNamespace(string $fullyQualifiedClassName)
3216
{
@@ -99,11 +83,6 @@ public function generate(Tree $tree, array $only = [], array $skip = [], $overwr
9983
return $components;
10084
}
10185

102-
public function defaultGenerators()
103-
{
104-
return $this->defaultGenerators;
105-
}
106-
10786
public function dump(array $generated)
10887
{
10988
return Yaml::dump($generated);

src/BlueprintServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function register()
7474
$blueprint->registerLexer(new \Blueprint\Lexers\SeederLexer());
7575
$blueprint->registerLexer(new \Blueprint\Lexers\ControllerLexer(new \Blueprint\Lexers\StatementLexer()));
7676

77-
foreach (collect($blueprint->defaultGenerators())->merge(config('blueprint.generators'))->toArray() as $key => $generator) {
77+
foreach (config('blueprint.generators') as $generator) {
7878
$blueprint->registerGenerator(new $generator($app['files']));
7979
}
8080

0 commit comments

Comments
 (0)