From ff928e8d58c79b4f8409ce1088cc6119f88ce0d5 Mon Sep 17 00:00:00 2001 From: Lupacescu Eduard Date: Wed, 29 Apr 2020 14:41:57 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Commands/RepositoryCommand.php | 16 ++++++++-------- src/Controllers/RestResponse.php | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Commands/RepositoryCommand.php b/src/Commands/RepositoryCommand.php index 5f0a332c5..11303a632 100644 --- a/src/Commands/RepositoryCommand.php +++ b/src/Commands/RepositoryCommand.php @@ -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 @@ -55,7 +55,7 @@ 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())) { @@ -63,14 +63,14 @@ protected function guessQualifiedModelName($name = null) } /* * 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); @@ -79,7 +79,7 @@ protected function buildMigration() if ($yes) { $this->call('make:migration', [ 'name' => $migration, - '--create' => $table + '--create' => $table, ]); } } @@ -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)]); } } } @@ -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() diff --git a/src/Controllers/RestResponse.php b/src/Controllers/RestResponse.php index c3ce04f1f..579039dd5 100644 --- a/src/Controllers/RestResponse.php +++ b/src/Controllers/RestResponse.php @@ -200,7 +200,7 @@ public function errors($errors) */ public function addError($message) { - if (!isset($this->errors)) { + if (! isset($this->errors)) { $this->errors = []; } @@ -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; } @@ -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)); @@ -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();