package and depencies
This commit is contained in:
@@ -21,8 +21,8 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
*/
|
||||
class Connection
|
||||
{
|
||||
private $host;
|
||||
private $contextProviders;
|
||||
private string $host;
|
||||
private array $contextProviders;
|
||||
|
||||
/**
|
||||
* @var resource|null
|
||||
|
16
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
16
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
@@ -24,8 +24,8 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class DumpServer
|
||||
{
|
||||
private $host;
|
||||
private $logger;
|
||||
private string $host;
|
||||
private ?LoggerInterface $logger;
|
||||
|
||||
/**
|
||||
* @var resource|null
|
||||
@@ -56,25 +56,19 @@ class DumpServer
|
||||
}
|
||||
|
||||
foreach ($this->getMessages() as $clientId => $message) {
|
||||
if ($this->logger) {
|
||||
$this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]);
|
||||
}
|
||||
$this->logger?->info('Received a payload from client {clientId}', ['clientId' => $clientId]);
|
||||
|
||||
$payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]);
|
||||
|
||||
// Impossible to decode the message, give up.
|
||||
if (false === $payload) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
|
||||
}
|
||||
$this->logger?->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
|
||||
}
|
||||
$this->logger?->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user