@ -414,12 +419,48 @@ class YamlHandler extends Handler {
This theoretical class uses the [`symfony/yaml`][c] package in Composer and exposes a few of its options as options for the Handler. Using this class would be very similar to the examples provided at the beginning of this document:
```php
#!/usr/bin/env php
<?php
use MensBeam\Foundation\Catcher,
Your\Namespace\Goes\Here\YamlHandler;
require_once('vendor/autoload.php');
$catcher = new Catcher(new YamlHandler([
'outputNullAsTilde' => true
]);
```
More complex handlers are possible by extending the various methods documented above. Examples can be seen by looking at the code for both `HTMLHandler` and `PlainTextHandler`.
More complex handlers are possible by extending the various methods documented above. Examples can be seen by looking at the code for both `HTMLHandler` and `PlainTextHandler`.
## Setting a Custom Variable Exporter
By default internally [`print_r`][e] is used. This is due to tests made internally where it performed the best out of built-in options, including other functions which might otherwise be preferred. Starting in v1.0.2 `Handler`'s `varExporter` option allows for defining how arguments are printed in backtraces in Catcher. Here is an example:
This example above uses the symfony/var-exporter package for a more modern human-readable variable export. However, using any variable printer is possible.