nette/nette — pull request #1090 by HosipLan (2013-05-08 13:21:56+00:00)
Title: Dumper: allow custom class handlers

I have classes, which internals are not important. Collections for example. There is a class `PersistentCollection` in Doctrine, that holds a lot of information that I don't care about (connection to database, ...) and I only care about the entities it holds.

This would allow me to write

```php
Nette\Diagnostics\Dumper::addClassDumper('Doctrine\ORM\PersistentCollection', function ($pc) {
return $pc->toArray();
});
```

And have nice dumps. Compare

![persistentcollection](https://f.cloud.github.com/assets/158625/477447/3541dbac-b7e2-11e2-88e9-818d072f4454.png)

with much nicer

![persistentcollection-better](https://f.cloud.github.com/assets/158625/477436/d1ee38f2-b7e1-11e2-9d4e-f28298f7790f.png)