File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public function __construct()
2424 $ command = $ argv ;
2525
2626 $ arguments = array_slice ($ command , 2 );
27- $ options = getopt ('h ' , ['help ' , ' host: ' , ' port: ' ]);
27+ $ options = getopt ('h ' , ['help ' ]);
2828
2929 if (
3030 isset ($ options ['help ' ]) ||
@@ -37,7 +37,7 @@ public function __construct()
3737 # Handle commands
3838 switch ($ command [1 ]) {
3939 case 'serve ' :
40- self ::$ serve = $ options ;
40+ self ::$ serve = $ arguments ;
4141 break ;
4242
4343 case 'make:controller ' :
Original file line number Diff line number Diff line change @@ -142,12 +142,14 @@ public function showCommands(): void
142142 /**
143143 * Server constructor.
144144 *
145- * @param array $options The Host and Port stored in here
145+ * @param array $arguments The Host and Port stored in here
146146 */
147- public function __construct (array $ options )
147+ public function __construct (array $ arguments )
148148 {
149- $ this ->host = isset ($ options ['host ' ]) ? $ options ['host ' ] : 'localhost ' ;
150- $ this ->port = isset ($ options ['port ' ]) ? (int ) $ options ['port ' ] : 2200 ;
149+ $ http = explode (': ' , $ arguments [0 ] ?? '' );
150+
151+ $ this ->host = isset ($ http [0 ]) ? $ http [0 ] : 'localhost ' ;
152+ $ this ->port = isset ($ http [1 ]) ? (int ) $ http [1 ] : 2200 ;
151153 $ this ->resolve = 'src/boostrap/ ' ;
152154
153155 // Check if the provided local address and its port is in use.
You can’t perform that action at this time.
0 commit comments