-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support arrays in config loader; add env
TRAP_TCP_PORTS
and `TRAP_T…
…CP_HOST`
- Loading branch information
Showing
3 changed files
with
69 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Buggregator\Trap\Config\Server; | ||
|
||
use Buggregator\Trap\Service\Config\Env; | ||
use Buggregator\Trap\Service\Config\InputOption; | ||
|
||
/** | ||
* Config is a projection of plain TCP ports configuration via ENV and CLI | ||
* | ||
* @internal | ||
* @psalm-internal Buggregator\Trap | ||
*/ | ||
final class TcpPorts | ||
{ | ||
/** | ||
* List of TCP ports to listen | ||
* | ||
* @var list<int<1, 65535>> | ||
*/ | ||
#[Env('TRAP_TCP_PORTS')] | ||
#[InputOption('port')] | ||
public array $ports = [9912, 9913]; | ||
|
||
/** | ||
* Host to listen | ||
* | ||
* @var non-empty-string | ||
*/ | ||
#[Env('TRAP_TCP_HOST')] | ||
public string $host = '127.0.0.1'; | ||
|
||
public string $type = 'tcp'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters