Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
gogl92 authored and github-actions[bot] committed Oct 13, 2024
1 parent 068b173 commit df0a260
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/Commands/OrionTypescriptCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class OrionTypescriptCommand extends Command

/**
* Create a new command instance.
*
* @param \Illuminate\Contracts\Config\Repository $config
*/
public function __construct(Repository $config)
{
Expand All @@ -48,8 +46,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;
}

Expand All @@ -64,20 +63,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)
Expand All @@ -87,9 +83,6 @@ protected function getConnection($modelInstance)

/**
* Get the schema name for the given connection.
*
* @param string $connection
* @return string
*/
protected function getSchema(string $connection): string
{
Expand All @@ -98,9 +91,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)
{
Expand Down

0 comments on commit df0a260

Please sign in to comment.