Skip to content

Commit

Permalink
style: Apply fixes from StyleCI (#63)
Browse files Browse the repository at this point in the history
Co-authored-by: StyleCI Bot <bot@styleci.io>
  • Loading branch information
mitulgolakiya and StyleCIBot authored Feb 22, 2022
1 parent 9352c74 commit 7ae76cd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions config/generator_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

'field-template' => 'generator-builder::field-template',

'relation-field-template' => 'generator-builder::relation-field-template'
]
];
'relation-field-template' => 'generator-builder::relation-field-template',
],
];
9 changes: 4 additions & 5 deletions src/Commands/GeneratorBuilderRoutesPublisherCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ private function publishRoutes()

$routeContents = file_get_contents($path);

$builderRoutes = file_get_contents(__DIR__ . "/../../templates/routes.stub");
$builderRoutes = file_get_contents(__DIR__.'/../../templates/routes.stub');

file_put_contents($path, $routeContents . "\n\n" . $builderRoutes);
file_put_contents($path, $routeContents."\n\n".$builderRoutes);

$this->comment("\nBuilder routes added to routes.php");
}
Expand All @@ -54,7 +54,7 @@ private function publishRoutes()
*/
public function publishViews()
{
$sourceDir = __DIR__ . "/../../views/";
$sourceDir = __DIR__.'/../../views/';
$destinationDir = base_path('resources/views/infyom/generator-builder/');

if (file_exists($destinationDir)) {
Expand All @@ -76,8 +76,7 @@ public function publishViews()
public function getOptions()
{
return [
['views', null, InputOption::VALUE_NONE, 'Publishes views as well']
['views', null, InputOption::VALUE_NONE, 'Publishes views as well'],
];
}

}
6 changes: 3 additions & 3 deletions src/Controllers/GeneratorBuilderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function builder()
{
return view(config('infyom.generator_builder.views.builder'));
}

public function fieldTemplate()
{
return view(config('infyom.generator_builder.views.field-template'));
Expand All @@ -37,7 +37,7 @@ public function generate(BuilderGenerateRequest $request)
$this->validateFields($data['fields']);

// prepare foreign key
$isAnyForeignKey = collect($data['fields'])->filter(function ($field) {
$isAnyForeignKey = collect($data['fields'])->filter(function ($field) {
return $field['isForeign'] == true;
});
if (count($isAnyForeignKey)) {
Expand All @@ -55,7 +55,7 @@ public function generate(BuilderGenerateRequest $request)
'--jsonFromGUI' => json_encode($data),
]);

return Response::json("Files created successfully");
return Response::json('Files created successfully');
}

public function rollback()
Expand Down
10 changes: 5 additions & 5 deletions src/GeneratorBuilderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@

class GeneratorBuilderServiceProvider extends ServiceProvider
{

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot() {
public function boot()
{
$configPath = __DIR__.'/../config/generator_builder.php';

$this->publishes([
$configPath => config_path('infyom/generator_builder.php'),
]);

$this->loadViewsFrom(__DIR__.'/../views/', 'generator-builder');
}

Expand All @@ -35,7 +35,7 @@ public function register()
});

$this->commands([
'infyom.publish.generator-builder'
'infyom.publish.generator-builder',
]);
}
}
}
8 changes: 4 additions & 4 deletions src/Requests/BuilderGenerateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public function authorize()
public function rules()
{
return [
'modelName' => 'required',
'fields' => 'required',
'commandType' => 'required'
'modelName' => 'required',
'fields' => 'required',
'commandType' => 'required',
];
}

Expand All @@ -44,4 +44,4 @@ public function response(array $errors)

return Response::json($messages, 400);
}
}
}

0 comments on commit 7ae76cd

Please sign in to comment.