update patch 1
This commit is contained in:
+4
-4
@@ -22,7 +22,6 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
class Connection
|
||||
{
|
||||
private string $host;
|
||||
private array $contextProviders;
|
||||
|
||||
/**
|
||||
* @var resource|null
|
||||
@@ -33,14 +32,15 @@ class Connection
|
||||
* @param string $host The server host
|
||||
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
|
||||
*/
|
||||
public function __construct(string $host, array $contextProviders = [])
|
||||
{
|
||||
public function __construct(
|
||||
string $host,
|
||||
private array $contextProviders = [],
|
||||
) {
|
||||
if (!str_contains($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->contextProviders = $contextProviders;
|
||||
}
|
||||
|
||||
public function getContextProviders(): array
|
||||
|
||||
+5
-5
@@ -25,27 +25,27 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
class DumpServer
|
||||
{
|
||||
private string $host;
|
||||
private ?LoggerInterface $logger;
|
||||
|
||||
/**
|
||||
* @var resource|null
|
||||
*/
|
||||
private $socket;
|
||||
|
||||
public function __construct(string $host, ?LoggerInterface $logger = null)
|
||||
{
|
||||
public function __construct(
|
||||
string $host,
|
||||
private ?LoggerInterface $logger = null,
|
||||
) {
|
||||
if (!str_contains($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function start(): void
|
||||
{
|
||||
if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) {
|
||||
throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno);
|
||||
throw new \RuntimeException(\sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user