Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions src/Commands/RepositoryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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 @@ -55,22 +55,22 @@ protected function guessQualifiedModelName($name = null)

if ($userDidntPassModel = is_null($class)) {
/*Check if the user didnt provide the model name*/
return str_replace('/', '\\', $this->rootNamespace() . '/Models//' . $model);
return str_replace('/', '\\', $this->rootNamespace().'/Models//'.$model);
}

if (Str::startsWith($class, $this->rootNamespace())) {
return str_replace('\\', '\\\\', $class);
}

/* * Assuming the class model doesn't contain the namespace * * */
return str_replace('/', '\\', $this->rootNamespace() . '/Models//' . $class);
return str_replace('/', '\\', $this->rootNamespace().'/Models//'.$class);
}

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 @@ -79,7 +79,7 @@ protected function buildMigration()
if ($yes) {
$this->call('make:migration', [
'name' => $migration,
'--create' => $table
'--create' => $table,
]);
}
}
Expand All @@ -93,7 +93,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 @@ -116,12 +116,12 @@ public function tryAll()

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
8 changes: 4 additions & 4 deletions src/Controllers/RestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function errors($errors)
*/
public function addError($message)
{
if (!isset($this->errors)) {
if (! isset($this->errors)) {
$this->errors = [];
}

Expand Down Expand Up @@ -285,7 +285,7 @@ public function __get($key)
return $this->$key;
}

$code = 'static::REST_RESPONSE_' . strtoupper($key) . '_CODE';
$code = 'static::REST_RESPONSE_'.strtoupper($key).'_CODE';

return defined($code) ? constant($code) : null;
}
Expand All @@ -300,7 +300,7 @@ public function __get($key)
*/
public function __call($func, $args)
{
$code = 'static::REST_RESPONSE_' . strtoupper($func) . '_CODE';
$code = 'static::REST_RESPONSE_'.strtoupper($func).'_CODE';

if (defined($code)) {
return $this->code(constant($code));
Expand All @@ -318,7 +318,7 @@ public function __call($func, $args)
*/
public function respond($response = null)
{
if (!func_num_args()) {
if (! func_num_args()) {
$response = new \stdClass();
$response->data = new \stdClass();

Expand Down