Skip to content

Commit

Permalink
Merge pull request #126 from hydephp/analysis-ajRJRm
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
caendesilva authored Apr 17, 2022
2 parents e54a394 + 3364161 commit 28d7247
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions src/Commands/HydeServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,35 @@ class HydeServeCommand extends Command
public function handle(): int
{
if (! $this->canRunServer()) {
$this->error('Could not start the server.');
$this->error('Could not start the server.');

return 1;
}
return 1;
}

$this->line('<info>Starting the server...</info> Press Ctrl+C to stop');
$this->line('<info>Starting the server...</info> Press Ctrl+C to stop');

$this->warn('This feature is experimental. Please report any issues on GitHub.');
$this->warn('This feature is experimental. Please report any issues on GitHub.');

$port = $this->option('port');
$host = $this->option('host');
passthru("php -S $host:$port " . Hyde::path('vendor/hyde/realtime-compiler/server.php'));
$port = $this->option('port');
$host = $this->option('host');
passthru("php -S $host:$port ".Hyde::path('vendor/hyde/realtime-compiler/server.php'));

return 0;
}

/**
* Check if the server can be started.
*
* @return bool
*/
protected function canRunServer(): bool
{

if (! file_exists(Hyde::path('vendor/hyde/realtime-compiler/server.php'))) {
$this->warn('The realtime compiler extension is not installed.');
/**
* Check if the server can be started.
*
* @return bool
*/
protected function canRunServer(): bool
{
if (! file_exists(Hyde::path('vendor/hyde/realtime-compiler/server.php'))) {
$this->warn('The realtime compiler extension is not installed.');

return false;
}
return false;
}

return true;
}
return true;
}
}

0 comments on commit 28d7247

Please sign in to comment.