Skip to content

Commit

Permalink
feat(frontend): set debug ports to 1025, 8000, 9912, 9913 by …
Browse files Browse the repository at this point in the history
…default
  • Loading branch information
roxblnfk committed Jun 15, 2024
1 parent 3b7e4df commit d0bbb74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(

// Frontend
$feConfig = $this->container->get(FrontendConfig::class);
$feSeparated = $withFrontend && !\in_array(
$feSeparated = !\in_array(
$feConfig->port,
\array_map(static fn(SocketServer $item): ?int => $item->type === 'tcp' ? $item->port : null, $map, ),
true,

Check warning on line 61 in src/Application.php

View check run for this annotation

Codecov / codecov/patch

src/Application.php#L57-L61

Added lines #L57 - L61 were not covered by tests
Expand All @@ -80,7 +80,8 @@ public function __construct(
]);
$this->processors[] = $inspector;

if (!$feSeparated) {

if ($withFrontend && !$feSeparated) {
$inspectorWithFrontend = $container->make(Inspector::class, [
new Traffic\Dispatcher\VarDumper(),
new Traffic\Dispatcher\Http(

Check warning on line 87 in src/Application.php

View check run for this annotation

Codecov / codecov/patch

src/Application.php#L84-L87

Added lines #L84 - L87 were not covered by tests
Expand All @@ -103,7 +104,7 @@ public function __construct(
$this->configureFileObserver();

foreach ($map as $config) {
!$feSeparated && $config->type === 'tcp' && $config->port === $feConfig->port
$withFrontend && !$feSeparated && $config->type === 'tcp' && $config->port === $feConfig->port
? $this->prepareServerFiber($config, $inspectorWithFrontend, $this->logger)
: $this->prepareServerFiber($config, $inspector, $this->logger);

Check warning on line 109 in src/Application.php

View check run for this annotation

Codecov / codecov/patch

src/Application.php#L107-L109

Added lines #L107 - L109 were not covered by tests
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Run.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getServers(Container $container): array
$config = $container->get(TcpPorts::class);

$servers = [];
$ports = $config->ports ?: [9912];
$ports = $config->ports ?: [1025, 8000, 9912, 9913];

Check warning on line 66 in src/Command/Run.php

View check run for this annotation

Codecov / codecov/patch

src/Command/Run.php#L66

Added line #L66 was not covered by tests
/** @var scalar $port */
foreach ($ports as $port) {
\is_numeric($port) or throw new \InvalidArgumentException(
Expand Down

0 comments on commit d0bbb74

Please sign in to comment.