mirror of
https://github.com/filp/whoops.git
synced 2026-10-03 10:37:50 +00:00
CS fixes
This commit is contained in:
+14
-10
@@ -14,33 +14,36 @@
|
||||
*/
|
||||
|
||||
namespace Whoops\Example;
|
||||
use Whoops\Run;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
|
||||
use Exception as BaseException;
|
||||
use Whoops\Handler\PrettyPageHandler;
|
||||
use Whoops\Run;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
class Exception extends BaseException {}
|
||||
class Exception extends BaseException
|
||||
{
|
||||
}
|
||||
|
||||
$run = new Run;
|
||||
$handler = new PrettyPageHandler;
|
||||
$run = new Run();
|
||||
$handler = new PrettyPageHandler();
|
||||
|
||||
// Add a custom table to the layout:
|
||||
$handler->addDataTable('Ice-cream I like', array(
|
||||
'Chocolate' => 'yes',
|
||||
'Coffee & chocolate' => 'a lot',
|
||||
'Strawberry & chocolate' => 'it\'s alright',
|
||||
'Vanilla' => 'ew'
|
||||
'Vanilla' => 'ew',
|
||||
));
|
||||
|
||||
$run->pushHandler($handler);
|
||||
|
||||
// Example: tag all frames inside a function with their function name
|
||||
$run->pushHandler(function($exception, $inspector, $run) {
|
||||
$run->pushHandler(function ($exception, $inspector, $run) {
|
||||
|
||||
$inspector->getFrames()->map(function($frame) {
|
||||
$inspector->getFrames()->map(function ($frame) {
|
||||
|
||||
if($function = $frame->getFunction()) {
|
||||
if ($function = $frame->getFunction()) {
|
||||
$frame->addComment("This frame is within function '$function'", 'cpt-obvious');
|
||||
}
|
||||
|
||||
@@ -51,7 +54,8 @@ $run->pushHandler(function($exception, $inspector, $run) {
|
||||
|
||||
$run->register();
|
||||
|
||||
function fooBar() {
|
||||
function fooBar()
|
||||
{
|
||||
throw new Exception("Something broke!");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user