<?php

namespace Dephpug\Parse;

use Dephpug\MessageEvent as MessageParse;
use Dephpug\MessageParse as MessageParser;
use Dephpug\Output;

class VerboseModeMessageEvent extends MessageParse
{
    public function match(string $xml)
    {
        if($this->core->config->debugger['verboseMode']) {
            $messageParser = new MessageParser();
            $xml = $messageParser->xmlBeautifier($xml);
            try {
                Output::print("\n<comment>{$xml}</comment>\n");
            } catch (\Exception $e) {
                echo $xml;
            }
        }
    }

    public function exec()
    {
        $this->core->dbgpServer->sendCommand('run -i 1');
    }
}

<?php

namespace Dephpug\Parse;

use Dephpug\MessageEvent as MessageParse;
use Dephpug\MessageParse as MessageParser;
use Dephpug\Output;

class VerboseModeMessageEvent extends MessageParse
{
    public function match(string $xml)
    {
        if($this->core->config->debugger['verboseMode']) {
            $messageParser = new MessageParser();
            $xml = $messageParser->xmlBeautifier($xml);
            Output::print("\n<comment>{$xml}</comment>\n");
        }
    }

    public function exec()
    {
        $this->core->dbgpServer->sendCommand('run -i 1');
    }
}

--- 
+++ 
@@ -13,7 +13,11 @@
         if($this->core->config->debugger['verboseMode']) {
             $messageParser = new MessageParser();
             $xml = $messageParser->xmlBeautifier($xml);
-            Output::print("\n<comment>{$xml}</comment>\n");
+            try {
+                Output::print("\n<comment>{$xml}</comment>\n");
+            } catch (\Exception $e) {
+                echo $xml;
+            }
         }
     }
 
Fix bug in Message Parse with symfony console
