Skip to content

Commit 3b76c7a

Browse files
author
Xavier Barbosa
committed
Added exceptions renderer.
1 parent b707764 commit 3b76c7a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/Renderers/Exception.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Madewithlove\LaravelDebugConsole\Renderers;
4+
5+
class Exception extends AbstractRenderer
6+
{
7+
/**
8+
* @param array $data
9+
*/
10+
public function render(array $data)
11+
{
12+
$this->output->title('Exceptions');
13+
14+
foreach (array_get($data, 'exceptions.exceptions', []) as $exception) {
15+
$this->output->block(array_get($exception, 'message'), array_get($exception, 'type'), 'fg=white;bg=red', ' ', true);
16+
$this->output->text(array_get($exception, 'file') . '#' . array_get($exception, 'line'));
17+
$this->output->newLine();
18+
$this->output->block(array_get($exception, 'surrounding_lines'), null, 'fg=yellow', ' ! ');
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)