Skip to content

Commit

Permalink
Fix default scaffolding stub files to conform to coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Dec 18, 2024
1 parent fb92ce3 commit 27207c2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
6 changes: 4 additions & 2 deletions modules/backend/console/scaffold/controller/controller.stub
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php namespace {{ plugin_namespace }}\Controllers;
<?php

namespace {{ plugin_namespace }}\Controllers;

use BackendMenu;
use Backend\Classes\Controller;
use Backend\Facades\BackendMenu;

/**
* {{ title_name }} Backend Controller
Expand Down
4 changes: 3 additions & 1 deletion modules/backend/console/scaffold/formwidget/formwidget.stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace {{studly_author}}\{{studly_plugin}}\FormWidgets;
<?php

namespace {{studly_author}}\{{studly_plugin}}\FormWidgets;

use Backend\Classes\FormWidgetBase;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace {{studly_author}}\{{studly_plugin}}\ReportWidgets;
<?php

namespace {{studly_author}}\{{studly_plugin}}\ReportWidgets;

use Backend\Classes\ReportWidgetBase;
use Exception;
Expand Down Expand Up @@ -29,7 +31,7 @@ class {{studly_name}} extends ReportWidgetBase
],
];
}

/**
* Adds widget specific asset files. Use $this->addJs() and $this->addCss()
* to register new assets to include on the page.
Expand All @@ -38,7 +40,7 @@ class {{studly_name}} extends ReportWidgetBase
protected function loadAssets()
{
}

/**
* Renders the widget's primary contents.
* @return string HTML markup supplied by this widget.
Expand Down
6 changes: 5 additions & 1 deletion modules/system/console/scaffold/job/job.batched.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ use Illuminate\Queue\SerializesModels;

class {{studly_name}} implements ShouldQueue
{
use Batchable, Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use Batchable;
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;

/**
* Create a new job instance.
Expand Down
5 changes: 4 additions & 1 deletion modules/system/console/scaffold/job/job.queued.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use Illuminate\Queue\SerializesModels;

class {{studly_name}} implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;

/**
* Create a new job instance.
Expand Down
6 changes: 2 additions & 4 deletions modules/system/console/scaffold/plugin/plugin.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace {{ plugin_namespace }};

use Backend;
use Backend\Facades\Backend;
use Backend\Models\UserRole;
use System\Classes\PluginBase;

Expand All @@ -20,7 +20,7 @@ class Plugin extends PluginBase
'name' => '{{ plugin_id }}::lang.plugin.name',
'description' => '{{ plugin_id }}::lang.plugin.description',
'author' => '{{ author }}',
'icon' => 'icon-leaf'
'icon' => 'icon-leaf',
];
}

Expand All @@ -29,15 +29,13 @@ class Plugin extends PluginBase
*/
public function register(): void
{

}

/**
* Boot method, called right before the request route.
*/
public function boot(): void
{

}

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/system/console/scaffold/settings/model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace {{ plugin_namespace }}\Models;

use Model;
use Winter\Storm\Database\Model;

/**
* {{name}} Model
Expand Down
2 changes: 1 addition & 1 deletion modules/system/console/scaffold/test/test.plugin.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace {{ plugin_namespace }}\Tests\Unit;

use {{ plugin_namespace }}\Plugin;
use System\Classes\PluginBase;
use System\Tests\Bootstrap\PluginTestCase;
use {{ plugin_namespace }}\Plugin;

class PluginTest extends PluginTestCase
{
Expand Down

0 comments on commit 27207c2

Please sign in to comment.