From 08011b5e8f7541ee622792952f38f258321f5670 Mon Sep 17 00:00:00 2001 From: gogl92 Date: Sun, 13 Oct 2024 07:44:17 +0000 Subject: [PATCH] Fix styling --- src/Commands/OrionTypescriptCommand.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Commands/OrionTypescriptCommand.php b/src/Commands/OrionTypescriptCommand.php index d9478ba..83dfe7a 100644 --- a/src/Commands/OrionTypescriptCommand.php +++ b/src/Commands/OrionTypescriptCommand.php @@ -3,8 +3,8 @@ namespace Inquid\LaravelGii\Commands; use Illuminate\Console\Command; -use Illuminate\Support\Facades\Schema; use Illuminate\Contracts\Config\Repository; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; class OrionTypescriptCommand extends Command @@ -32,8 +32,6 @@ class OrionTypescriptCommand extends Command /** * Create a new command instance. - * - * @param Repository $config */ public function __construct(Repository $config) { @@ -50,8 +48,9 @@ public function handle() $controller = $this->argument('controller'); $modelClass = $this->getModelClassFromController($controller); - if (!class_exists($modelClass)) { + if (! class_exists($modelClass)) { $this->error("Model for controller $controller does not exist."); + return; } @@ -66,20 +65,17 @@ public function handle() /** * Get the model class name from the controller name. - * - * @param string $controller - * @return string */ protected function getModelClassFromController(string $controller): string { $modelName = Str::replaceLast('Controller', '', $controller); + return "App\\Models\\$modelName"; } /** * Get the database connection for the model. * - * @param $modelInstance * @return string */ protected function getConnection($modelInstance) @@ -89,9 +85,6 @@ protected function getConnection($modelInstance) /** * Get the schema name for the given connection. - * - * @param string $connection - * @return string */ protected function getSchema(string $connection): string { @@ -100,9 +93,6 @@ protected function getSchema(string $connection): string /** * Generate the Orion TypeScript model. - * - * @param string $controller - * @param string $table */ protected function generateOrionModel(string $controller, string $table) {