44
55namespace Hyde \Console \Commands ;
66
7- use Illuminate \Support \Facades \Process ;
8- use function config ;
97use Hyde \Hyde ;
8+ use Hyde \Facades \Config ;
9+ use Illuminate \Support \Facades \Process ;
1010use LaravelZero \Framework \Commands \Command ;
1111use function sprintf ;
1212
@@ -28,8 +28,8 @@ public function handle(): int
2828 $ this ->line ('<info>Starting the HydeRC server...</info> Press Ctrl+C to stop ' );
2929
3030 $ this ->runServerProcess (sprintf ('php -S %s:%d %s ' ,
31- $ this ->getHostSelection () ?: ' localhost ' ,
32- $ this ->getPortSelection () ?: 8080 ,
31+ $ this ->getHostSelection (),
32+ $ this ->getPortSelection (),
3333 $ this ->getExecutablePath ()
3434 ));
3535
@@ -38,22 +38,23 @@ public function handle(): int
3838
3939 protected function getPortSelection (): int
4040 {
41- return (int ) ($ this ->option ('port ' ) ?: config ('hyde.server.port ' , 8080 ));
41+ return (int ) ($ this ->option ('port ' ) ?: Config:: getInt ('hyde.server.port ' , 8080 ));
4242 }
4343
4444 protected function getHostSelection (): string
4545 {
46- return $ this ->option ('host ' ) ?: config ('hyde.server.host ' , 'localhost ' );
46+ return ( string ) $ this ->option ('host ' ) ?: Config:: getString ('hyde.server.host ' , 'localhost ' );
4747 }
4848
4949 protected function getExecutablePath (): string
5050 {
5151 return Hyde::path ('vendor/hyde/realtime-compiler/bin/server.php ' );
5252 }
5353
54+ /** @codeCoverageIgnore Until output is testable */
5455 protected function runServerProcess (string $ command ): void
5556 {
56- Process::run ($ command , function ($ type , $ line ) {
57+ Process::run ($ command , function (string $ type , string $ line ): void {
5758 $ this ->output ->write ($ line );
5859 });
5960 }
0 commit comments