This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/VarDumper/Tests
Fabien Potencier ac8fd04d44 feature #15838 [VarDumper] Dump PHP+Twig code excerpts in backtraces (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Dump PHP+Twig code excerpts in backtraces

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

ExceptionCaster::filterTrace() is deprecated and replaced by a more flexible backtrace processing that allows one to register casters for amending/changing dumped backtraces. This is especially useful for dumping source map information/excerpts (like e.g. twig template source).

Here is a comparison generated with this code snippet (see also the expected output in  testThrowingCaster):
```php

namespace Symfony\Component\VarDumper\Caster;

require 'vendor/autoload.php';

function bar()
{
    return foo();
}

function foo()
{
    dump(new \Exception('baz'));
}

bar('aaaaarg');
```

Before:
![before](https://cloud.githubusercontent.com/assets/243674/9976794/88f0259a-5eef-11e5-81a8-3cb9b44cfb00.png)

After:
![after](https://cloud.githubusercontent.com/assets/243674/9976747/6bbac068-5eed-11e5-99dc-a4fd5d3172b5.png)

Commits
-------

89578f1 [VarDumper] Dump PHP+Twig code excerpts in backtraces
2015-09-30 14:12:04 +02:00
..
Caster [VarDumper] Add EnumStub for dumping virtual collections with casters 2015-09-20 23:07:38 +02:00
Fixtures [VarDumper] Dump PHP+Twig code excerpts in backtraces 2015-09-29 08:51:06 +02:00
Test [VarDumper] Fix dump comparison on large arrays 2015-09-22 16:41:01 +02:00
CliDumperTest.php [VarDumper] Dump PHP+Twig code excerpts in backtraces 2015-09-29 08:51:06 +02:00
HtmlDumperTest.php [VarDumper] Add EnumStub for dumping virtual collections with casters 2015-09-20 23:07:38 +02:00
VarClonerTest.php Fix merge 2015-07-01 14:07:40 +02:00