diff --git a/src/Command/FixerApplication.php b/src/Command/FixerApplication.php index 72a7263d15..de0a04ec24 100644 --- a/src/Command/FixerApplication.php +++ b/src/Command/FixerApplication.php @@ -145,8 +145,8 @@ public function log(string $message): void ); $server->on('connection', function (ConnectionInterface $connection) use ($loop, $projectConfigFile, $input, $output, $fileSpecificErrors, $notFileSpecificErrors, $mainScript, $filesCount, $reanalyseProcessQueue, $inceptionResult): void { - $decoder = new Decoder($connection, true, 512, 0, 128 * 1024 * 1024); - $encoder = new Encoder($connection); + $decoder = new Decoder($connection, true, 512, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0, 128 * 1024 * 1024); + $encoder = new Encoder($connection, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0); $encoder->write(['action' => 'initialData', 'data' => [ 'fileSpecificErrors' => $fileSpecificErrors, 'notFileSpecificErrors' => $notFileSpecificErrors, diff --git a/src/Command/WorkerCommand.php b/src/Command/WorkerCommand.php index 185afdf07e..35f08d6d94 100644 --- a/src/Command/WorkerCommand.php +++ b/src/Command/WorkerCommand.php @@ -136,8 +136,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $tcpConector = new TcpConnector($loop); $tcpConector->connect(sprintf('127.0.0.1:%d', $port))->done(function (ConnectionInterface $connection) use ($container, $identifier, $output, $analysedFiles, $tmpFile, $insteadOfFile): void { - $out = new Encoder($connection); - $in = new Decoder($connection, true, 512, 0, $container->getParameter('parallel')['buffer']); + $out = new Encoder($connection, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0); + $in = new Decoder($connection, true, 512, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0, $container->getParameter('parallel')['buffer']); $out->write(['action' => 'hello', 'identifier' => $identifier]); $this->runWorker($container, $out, $in, $output, $analysedFiles, $tmpFile, $insteadOfFile); }); diff --git a/src/Parallel/ParallelAnalyser.php b/src/Parallel/ParallelAnalyser.php index 7160e10716..89fdb88654 100644 --- a/src/Parallel/ParallelAnalyser.php +++ b/src/Parallel/ParallelAnalyser.php @@ -65,8 +65,8 @@ public function analyse( $server = new \React\Socket\TcpServer('127.0.0.1:0', $loop); $this->processPool = new ProcessPool($server); $server->on('connection', function (ConnectionInterface $connection) use (&$jobs): void { - $decoder = new Decoder($connection, true, 512, 0, $this->decoderBufferSize); - $encoder = new Encoder($connection); + $decoder = new Decoder($connection, true, 512, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0, $this->decoderBufferSize); + $encoder = new Encoder($connection, defined('JSON_INVALID_UTF8_IGNORE') ? JSON_INVALID_UTF8_IGNORE : 0); $decoder->on('data', function (array $data) use (&$jobs, $decoder, $encoder): void { if ($data['action'] !== 'hello') { return;