Skip to content

Commit

Permalink
Apply fixes from StyleCI (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagomichaelsousa authored Apr 7, 2020
1 parent c9b3604 commit 466c8e1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/Commands/ResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ResourceCommand extends Command
*/
private function modelExists()
{
return File::exists(base_path(lcfirst(str_replace('\\', '/', config('laravel-resources.models.namespace')))) . "/{$this->model}.php");
return File::exists(base_path(lcfirst(str_replace('\\', '/', config('laravel-resources.models.namespace'))))."/{$this->model}.php");
}

/**
Expand All @@ -82,7 +82,6 @@ private function modelExists()
private function createModelResources()
{
foreach ($this->modelResources as $resource => $generator) {

if ($this->confirm("Should I create the {$resource} for {$this->model}?", true)) {
array_push($this->resources, $generator);
}
Expand All @@ -96,7 +95,7 @@ private function createModelResources()
*/
private function createResources()
{
$this->info('Creating ' . count($this->resources) . ' resources ...');
$this->info('Creating '.count($this->resources).' resources ...');
$this->line('');

$bar = $this->getOutput()->createProgressBar(count($this->resources));
Expand Down Expand Up @@ -128,10 +127,10 @@ public function handle()

$this->model = $this->argument('model');

if (!$this->modelExists($this->model)) {
if (! $this->modelExists($this->model)) {
$this->info("The model {$this->model} does not exists.");

if (!$this->confirm('Should I create it?', true)) {
if (! $this->confirm('Should I create it?', true)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Generators/FactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct($model)
*/
public function getStub()
{
return File::get(__DIR__ . '/../stubs/factories/factory.stub');
return File::get(__DIR__.'/../stubs/factories/factory.stub');
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Generators/MigrationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct($model)
*/
public function getStub()
{
return File::get(__DIR__ . '/../stubs/migrations/migration.stub');
return File::get(__DIR__.'/../stubs/migrations/migration.stub');
}

/**
Expand Down Expand Up @@ -79,6 +79,7 @@ public function directoryExists($path)
public function className()
{
$name = Str::plural($this->model);

return "Create{$name}Table";
}

Expand All @@ -89,8 +90,9 @@ public function className()
*/
public function fileName()
{
$date = Carbon::now()->format("Y_m_d_Hms");
$date = Carbon::now()->format('Y_m_d_Hms');
$name = Str::lower(Str::snake($this->className()));

return "{$date}_{$name}.php";
}

Expand Down
3 changes: 2 additions & 1 deletion src/Generators/SeederGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct($model)
*/
public function getStub()
{
return File::get(__DIR__ . '/../stubs/seeds/seed.stub');
return File::get(__DIR__.'/../stubs/seeds/seed.stub');
}

/**
Expand Down Expand Up @@ -80,6 +80,7 @@ public function directoryExists($path)
public function className()
{
$plural = Str::plural($this->model);

return "{$plural}TableSeeder";
}

Expand Down

0 comments on commit 466c8e1

Please sign in to comment.