Code Duplication    Length = 12-13 lines in 3 locations

src/Emitter/CommandLineEmitter.php 1 location

@@ 24-35 (lines=12) @@
21
            $exception->getMessage()
22
        );
23
24
        if ($this->options['includeTrace']) {
25
            $output .= "\n\n";
26
27
            $trace = $exception->getTrace();
28
            $traceLength = count($trace);
29
30
            $output .= "Stacktrace:\n";
31
            foreach ($trace as $i => $traceRecord) {
32
                $output .= $this->formatTraceRecord($traceRecord, $i, $traceLength);
33
                $output .= "\n";
34
            }
35
        }
36
37
        return $output;
38
    }

src/Emitter/HtmlEmitter.php 1 location

@@ 24-36 (lines=13) @@
21
    {
22
        $html = '<p>' . $exception->getMessage() . '</p>';
23
24
        if ($this->options['includeTrace']) {
25
            $html .= "\n";
26
            $html .= '<strong>Trace:</strong><br>';
27
            $html .= "\n";
28
29
            $trace = $exception->getTrace();
30
            $traceLength = count($trace);
31
32
            foreach ($exception->getTrace() as $i => $traceRecord) {
33
                $html .= "\n";
34
                $html .= $this->formatTraceRecord($traceRecord, $i, $traceLength) . '<br>';
35
            }
36
        }
37
38
        if ($previous = $exception->getPrevious()) {
39
            $html .= "\n";

src/Emitter/PlainTextEmitter.php 1 location

@@ 19-30 (lines=12) @@
16
            $exception->getMessage()
17
        );
18
19
        if ($this->options['includeTrace']) {
20
            $text .= "\n\n";
21
22
            $trace = $exception->getTrace();
23
            $traceLength = count($trace);
24
25
            $text .= "Stacktrace:\n";
26
            foreach ($trace as $i => $traceRecord) {
27
                $text .= $this->formatTraceRecord($traceRecord, $i, $traceLength);
28
                $text .= "\n";
29
            }
30
        }
31
32
        return $text;
33
    }