kint-php / kint

Kint - Advanced PHP dumper
https://kint-php.github.io/kint/
MIT License
2.78k stars 292 forks source link

Exclude dumping of objects of specific class #185

Closed tinnerdxp closed 7 years ago

tinnerdxp commented 8 years ago

In Symfony2 or any other framework using dependency injection container - it would be great to be able to specify in the config that any reference to a class of a given instance should not be expanded.

Steveb-p commented 8 years ago

This would be great if classes/interfaces like Doctrine Proxy or Symfony Form could be excluded, especially from the iteration. Symfony form dissalows iteration on itself after construction as far as I'm aware, causing Kint to error out. In case of Doctrine Proxy, it causes loading of elements, which in a lot of cases would slow down the execution.

jnvsor commented 7 years ago

Implemented in 2.x-dev. Please test and give feedback, thanks!

You can block classes by adding them to Kint_Parser_Blacklist::$blacklist and prevent iteration with Kint_Parser_Iterator::$blacklist