Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/Commands/RepositoryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RepositoryCommand extends GeneratorCommand

public function handle()
{
if (parent::handle() === false && !$this->option('force')) {
if (parent::handle() === false && ! $this->option('force')) {
return false;
}

Expand Down Expand Up @@ -56,7 +56,7 @@ public function handle()

/**
* Build the class with the given name.
* This method should return the file class content
* This method should return the file class content.
*
* @param string $name
* @return string
Expand All @@ -81,14 +81,14 @@ protected function guessQualifiedModelName()
{
$model = Str::singular(class_basename(Str::before($this->getNameInput(), 'Repository')));

return str_replace('/', '\\', $this->rootNamespace() . '/Models//' . $model);
return str_replace('/', '\\', $this->rootNamespace().'/Models//'.$model);
}

protected function buildMigration()
{
$table = Str::snake(Str::pluralStudly(class_basename($this->guessQualifiedModelName())));

$guessMigration = 'Create' . Str::studly($table) . 'Table';
$guessMigration = 'Create'.Str::studly($table).'Table';

if (false === class_exists($guessMigration)) {
$migration = Str::snake($guessMigration);
Expand All @@ -97,7 +97,7 @@ protected function buildMigration()
if ($yes) {
$this->call('make:migration', [
'name' => $migration,
'--create' => $table
'--create' => $table,
]);
}
}
Expand All @@ -120,7 +120,7 @@ protected function buildModel()
$yes = $this->confirm("Do you want to generate the model [{$model}]?");

if ($yes) {
$this->call('make:model', ['name' => str_replace('\\\\', '\\', $model),]);
$this->call('make:model', ['name' => str_replace('\\\\', '\\', $model)]);
}
}
}
Expand All @@ -131,18 +131,18 @@ protected function buildFactory()

$this->call('make:factory', [
'name' => "{$factory}Factory",
'--model' => str_replace('\\\\', '\\', $this->guessQualifiedModelName())
'--model' => str_replace('\\\\', '\\', $this->guessQualifiedModelName()),
]);
}

protected function getStub()
{
return __DIR__ . '/stubs/repository.stub';
return __DIR__.'/stubs/repository.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\Restify';
return $rootNamespace.'\Restify';
}

protected function getOptions()
Expand Down