for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the sj-i/php-profiler package.
*
* (c) sji <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace PhpProfiler\Inspector\Output;
use PhpProfiler\Lib\PhpProcessReader\CallTrace;
final class CallTraceFormatter
{
private CallFrameFormatter $call_frame_formatter;
public function __construct(
CallFrameFormatter $call_frame_formatter
) {
$this->call_frame_formatter = $call_frame_formatter;
}
public function format(CallTrace $call_trace): string
$frames = [];
foreach ($call_trace->call_frames as $call_frame) {
$frames[] = $this->call_frame_formatter->format($call_frame);
return join(PHP_EOL, $frames);