File tree Expand file tree Collapse file tree 3 files changed +46
-39
lines changed Expand file tree Collapse file tree 3 files changed +46
-39
lines changed Original file line number Diff line number Diff line change 22
33namespace Webfactor \Laravel \Generators \Commands ;
44
5- use Illuminate \ Console \ Command ;
5+ use Webfactor \ Laravel \ Generators \ Contracts \ CommandAbstract ;
66use Webfactor \Laravel \Generators \Contracts \ServiceInterface ;
77use Webfactor \Laravel \Generators \Schemas \Schema ;
88use Webfactor \Laravel \Generators \Services \AddToGitService ;
99use Webfactor \Laravel \Generators \Services \OpenIdeService ;
1010
11- class MakeEntity extends Command
11+ class MakeEntity extends CommandAbstract
1212{
1313 /**
1414 * The name and signature of the console command.
@@ -24,35 +24,13 @@ class MakeEntity extends Command
2424 */
2525 protected $ description = 'Make Entity ' ;
2626
27- /**
28- * Paths to files which should automatically be opened in IDE if the
29- * option --ide is set (and IDE capable).
30- *
31- * @var array
32- */
33- public $ filesToBeOpened = [];
34-
35- /**
36- * The name of the entity being created.
37- *
38- * @var string
39- */
40- public $ entity ;
41-
4227 /**
4328 * The Schema object.
4429 *
4530 * @var Schema
4631 */
4732 public $ schema ;
4833
49- /**
50- * The naming schema object.
51- *
52- * @var array
53- */
54- public $ naming = [];
55-
5634 /**
5735 * Execute the console command.
5836 *
@@ -123,17 +101,4 @@ private function executeService(ServiceInterface $service)
123101 {
124102 $ service ->call ();
125103 }
126-
127- /**
128- * Adds file to $filesToBeOpened stack.
129- *
130- * @param $file
131- * @return void
132- */
133- public function addFile (?\SplFileInfo $ file ): void
134- {
135- if ($ file ) {
136- array_push ($ this ->filesToBeOpened , $ file );
137- }
138- }
139104}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Webfactor \Laravel \Generators \Contracts ;
4+
5+ use Illuminate \Console \Command ;
6+
7+ abstract class CommandAbstract extends Command
8+ {
9+ /**
10+ * Paths to files which should automatically be opened in IDE if the
11+ * option --ide is set (and IDE capable).
12+ *
13+ * @var array
14+ */
15+ public $ filesToBeOpened = [];
16+
17+ /**
18+ * The name of the entity being created.
19+ *
20+ * @var string
21+ */
22+ public $ entity ;
23+
24+ /**
25+ * The naming classes.
26+ *
27+ * @var array
28+ */
29+ public $ naming = [];
30+
31+ /**
32+ * Adds file to $filesToBeOpened stack.
33+ *
34+ * @param $file
35+ * @return void
36+ */
37+ public function addFile (?\SplFileInfo $ file ): void
38+ {
39+ if ($ file ) {
40+ array_push ($ this ->filesToBeOpened , $ file );
41+ }
42+ }
43+ }
Original file line number Diff line number Diff line change 33namespace Webfactor \Laravel \Generators \Contracts ;
44
55use Illuminate \Filesystem \Filesystem ;
6- use Webfactor \Laravel \Generators \Commands \MakeEntity ;
76
87abstract class ServiceAbstract
98{
@@ -15,7 +14,7 @@ abstract class ServiceAbstract
1514
1615 protected $ filesystem ;
1716
18- public function __construct (MakeEntity $ command )
17+ public function __construct (CommandAbstract $ command )
1918 {
2019 $ this ->command = $ command ;
2120 $ this ->filesystem = new Filesystem ();
You can’t perform that action at this time.
0 commit comments