Skip to content

Commit 3c77013

Browse files
committed
Updated duration
1 parent df0caa0 commit 3c77013

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Console/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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':

src/Server.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)