Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default name to commands for lazy loading #63

Merged
merged 4 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion src/Foundation/Console/ClearCompiledCommand.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Winter\Storm\Foundation\Console;

use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Console\ClearCompiledCommand as ClearCompiledCommandBase;

class ClearCompiledCommand extends ClearCompiledCommandBase
Expand Down
14 changes: 0 additions & 14 deletions src/Foundation/Console/KeyGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@

class KeyGenerateCommand extends KeyGenerateCommandBase
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'key:generate';

/**
* The console command description.
*
* @var string
*/
protected $description = "Set the application key";

/**
* Create a new key generator command.
*
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreateCommand extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:command';
protected static $defaultName = 'create:command';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreateComponent extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:component';
protected static $defaultName = 'create:component';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
class CreateController extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:controller';
protected static $defaultName = 'create:controller';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateFormWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreateFormWidget extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:formwidget';
protected static $defaultName = 'create:formwidget';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreateModel extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:model';
protected static $defaultName = 'create:model';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreatePlugin extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:plugin';
protected static $defaultName = 'create:plugin';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateReportWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class CreateReportWidget extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:reportwidget';
protected static $defaultName = 'create:reportwidget';

/**
* The console command description.
Expand Down
7 changes: 3 additions & 4 deletions src/Scaffold/Console/CreateSettings.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?php namespace Winter\Storm\Scaffold\Console;

use Winter\Storm\Scaffold\GeneratorCommand;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class CreateSettings extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:settings {plugin} {settings=Settings}';
protected static $defaultName = 'create:settings';

/**
* The console command description.
Expand Down
6 changes: 3 additions & 3 deletions src/Scaffold/Console/CreateTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
class CreateTheme extends GeneratorCommand
{
/**
* The console command name.
* The default command name for lazy loading.
*
* @var string
* @var string|null
*/
protected $name = 'create:theme';
protected static $defaultName = 'create:theme';
LukeTowers marked this conversation as resolved.
Show resolved Hide resolved

/**
* The console command description.
Expand Down
2 changes: 1 addition & 1 deletion src/Scaffold/Console/command/command.stub
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class {{studly_name}} extends Command
/**
* @var string The console command name.
*/
protected $name = '{{lower_plugin}}:{{lower_name}}';
protected static $defaultName = '{{lower_plugin}}:{{lower_name}}';
bennothommo marked this conversation as resolved.
Show resolved Hide resolved

/**
* @var string The console command description.
Expand Down
27 changes: 9 additions & 18 deletions src/Scaffold/ScaffoldServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?php namespace Winter\Storm\Scaffold;

use Illuminate\Support\ServiceProvider;
use Winter\Storm\Scaffold\Console\CreateModel;
use Winter\Storm\Scaffold\Console\CreateSettings;
use Winter\Storm\Scaffold\Console\CreateTheme;
use Winter\Storm\Scaffold\Console\CreatePlugin;
use Winter\Storm\Scaffold\Console\CreateCommand;
use Winter\Storm\Scaffold\Console\CreateComponent;
use Winter\Storm\Scaffold\Console\CreateController;
use Winter\Storm\Scaffold\Console\CreateFormWidget;
use Winter\Storm\Scaffold\Console\CreateReportWidget;
use Illuminate\Contracts\Support\DeferrableProvider;

class ScaffoldServiceProvider extends ServiceProvider implements DeferrableProvider
Expand All @@ -20,15 +11,15 @@ class ScaffoldServiceProvider extends ServiceProvider implements DeferrableProvi
* @var array
*/
public $singletons = [
'command.create.theme' => CreateTheme::class,
'command.create.plugin' => CreatePlugin::class,
'command.create.model' => CreateModel::class,
'command.create.settings' => CreateSettings::class,
'command.create.controller' => CreateController::class,
'command.create.component' => CreateComponent::class,
'command.create.formwidget' => CreateFormWidget::class,
'command.create.reportwidget' => CreateReportWidget::class,
'command.create.command' => CreateCommand::class,
'command.create.theme' => \Winter\Storm\Scaffold\Console\CreateTheme::class,
'command.create.plugin' => \Winter\Storm\Scaffold\Console\CreatePlugin::class,
'command.create.model' => \Winter\Storm\Scaffold\Console\CreateModel::class,
'command.create.settings' => \Winter\Storm\Scaffold\Console\CreateSettings::class,
'command.create.controller' => \Winter\Storm\Scaffold\Console\CreateController::class,
'command.create.component' => \Winter\Storm\Scaffold\Console\CreateComponent::class,
'command.create.formwidget' => \Winter\Storm\Scaffold\Console\CreateFormWidget::class,
'command.create.reportwidget' => \Winter\Storm\Scaffold\Console\CreateReportWidget::class,
'command.create.command' => \Winter\Storm\Scaffold\Console\CreateCommand::class,
];

/**
Expand Down