File tree Expand file tree Collapse file tree 6 files changed +79
-6
lines changed
Expand file tree Collapse file tree 6 files changed +79
-6
lines changed Original file line number Diff line number Diff line change 33namespace Code16 \Sharp \Console ;
44
55use Illuminate \Console \GeneratorCommand ;
6- use Symfony \Component \Console \Input \InputOption ;
76
87class DashboardMakeCommand extends GeneratorCommand
98{
Original file line number Diff line number Diff line change 22
33namespace Code16 \Sharp \Console ;
44
5- use Illuminate \Support \Str ;
65use Illuminate \Console \GeneratorCommand ;
7- use Symfony \Component \Console \Input \InputOption ;
86
9- class CommandMakeCommand extends GeneratorCommand
7+ class EntityCommandMakeCommand extends GeneratorCommand
108{
119 /**
1210 * The console command name.
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Code16 \Sharp \Console ;
4+
5+ use Illuminate \Console \GeneratorCommand ;
6+
7+ class InstanceCommandMakeCommand extends GeneratorCommand
8+ {
9+ /**
10+ * The console command name.
11+ *
12+ * @var string
13+ */
14+ protected $ name = 'sharp:make:instance-command ' ;
15+
16+ /**
17+ * The console command description.
18+ *
19+ * @var string
20+ */
21+ protected $ description = 'Create a new instance command class ' ;
22+
23+ /**
24+ * The type of class being generated.
25+ *
26+ * @var string
27+ */
28+ protected $ type = 'InstanceCommand ' ;
29+
30+ /**
31+ * Get the stub file for the generator.
32+ *
33+ * @return string
34+ */
35+ protected function getStub ()
36+ {
37+ return __DIR__ .'/stubs/instance-command.stub ' ;
38+ }
39+
40+ /**
41+ * Get the default namespace for the class.
42+ *
43+ * @param string $rootNamespace
44+ * @return string
45+ */
46+ protected function getDefaultNamespace ($ rootNamespace )
47+ {
48+ return $ rootNamespace .'\Sharp ' ;
49+ }
50+ }
Original file line number Diff line number Diff line change 22
33namespace Code16 \Sharp \Console ;
44
5- use Illuminate \Support \Str ;
65use Illuminate \Console \GeneratorCommand ;
76use Symfony \Component \Console \Input \InputOption ;
87
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace DummyNamespace;
4+
5+ use Code16\Sharp\EntityList\Commands\InstanceCommand;
6+
7+ class DummyClass extends InstanceCommand
8+ {
9+ /**
10+ * @return string
11+ */
12+ public function label(): string
13+ {
14+ //
15+ }
16+
17+ /**
18+ * @param string $instanceId
19+ * @param array $data
20+ * @return array
21+ */
22+ public function execute($instanceId, array $data = []): array
23+ {
24+ //
25+ }
26+ }
Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ public function register()
8383 \Code16 \Sharp \Console \MediaMakeCommand::class,
8484 \Code16 \Sharp \Console \PolicyMakeCommand::class,
8585 \Code16 \Sharp \Console \ModelWizardCommand::class,
86- \Code16 \Sharp \Console \CommandMakeCommand::class,
86+ \Code16 \Sharp \Console \EntityCommandMakeCommand::class,
87+ \Code16 \Sharp \Console \InstanceCommandMakeCommand::class,
8788 \Code16 \Sharp \Console \DashboardMakeCommand::class,
8889 \Code16 \Sharp \Console \ValidatorMakeCommand::class,
8990 \Code16 \Sharp \Console \ListFilterMakeCommand::class,
You can’t perform that action at this time.
0 commit comments