@@ -115,17 +115,21 @@ public function debug(): void
115115
116116 $ methodName = $ cpInfo [$ this ->debugTraces ['method ' ]->getNameIndex ()]->getString ();
117117 $ descriptor = Formatter::parseSignature ($ cpInfo [$ this ->debugTraces ['method ' ]->getDescriptorIndex ()]->getString ());
118- $ formattedArguments = implode (
119- ', ' ,
120- array_map (
121- function ($ argument ) {
122- $ arrayBrackets = str_repeat ('[] ' , $ argument ['deep_array ' ]);
123- if ($ argument ['type ' ] === 'class ' ) {
124- return $ argument ['class_name ' ] . $ arrayBrackets ;
125- }
126- return $ argument ['type ' ] . $ arrayBrackets ;
127- },
128- $ descriptor ['arguments ' ]
118+ $ formattedArguments = str_replace (
119+ '/ ' ,
120+ '. ' ,
121+ implode (
122+ ', ' ,
123+ array_map (
124+ function ($ argument ) {
125+ $ arrayBrackets = str_repeat ('[] ' , $ argument ['deep_array ' ]);
126+ if ($ argument ['type ' ] === 'class ' ) {
127+ return $ argument ['class_name ' ] . $ arrayBrackets ;
128+ }
129+ return $ argument ['type ' ] . $ arrayBrackets ;
130+ },
131+ $ descriptor ['arguments ' ]
132+ )
129133 )
130134 );
131135
@@ -141,13 +145,25 @@ function ($argument) {
141145 printf (ltrim ("$ methodAccessibility $ type $ methodName( $ formattedArguments) \n" , ' ' ));
142146 printf ("\n" );
143147 printf ("[code] \n" );
148+
149+ $ codeCounter = 0 ;
144150 printf (
145151 "%s \n" ,
146152 implode (
147153 "\n" ,
148154 array_map (
149- function ($ code ) {
150- return '<0x ' . implode ('> <0x ' , $ code ) . '> ' ;
155+ function ($ codes ) use (&$ codeCounter ) {
156+ return implode (
157+ ' ' ,
158+ array_map (
159+ function ($ code ) use (&$ codeCounter ) {
160+ $ isMnemonic = in_array ($ codeCounter , $ this ->debugTraces ['mnemonic_indexes ' ]);
161+ $ codeCounter ++;
162+ return ($ isMnemonic ? "\e[1m \e[35m " : "" ) . "<0x {$ code }> " . ($ isMnemonic ? "\e[m " : "" );
163+ },
164+ $ codes
165+ )
166+ );
151167 },
152168 array_chunk (str_split (bin2hex ($ this ->debugTraces ['raw_code ' ]), 2 ), 20 )
153169 )
0 commit comments