Answer the question
In order to leave comments, you need to log in
How to properly change theme in symfony var-dumper?
I use symfony var-dumper separately from symfony. Decided to change the theme to light. To do this, I made the following function in my code:
function dump($data) {
$dumper = new \Symfony\Component\VarDumper\Dumper\HtmlDumper();
$dumper->setTheme('light');
$dumper->dump($data);
}
Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() must be an instance of Symfony\Component\VarDumper\Cloner\Data, instance of PhpOffice\PhpWord\Element\Section given, called in C:\laragon\www\word\index.php on line 12 and defined in C:\laragon\www\word\vendor\symfony\var-dumper\Dumper\HtmlDumper.php:142 Stack trace: #0 C:\laragon\www\word\index.php(12): Symfony\Component\VarDumper\Dumper\HtmlDumper->dump(Object(PhpOffice\PhpWord\Element\Section)) #1 C:\laragon\www\word\index.php(117): dump(Object(PhpOffice\PhpWord\Element\Section)) #2 {main} thrown in C:\laragon\www\word\vendor\symfony\var-dumper\Dumper\HtmlDumper.php on line 142
Answer the question
In order to leave comments, you need to log in
What do you have in $data ?
This class should be: Symfony\Component\VarDumper\Cloner\Data;
you also write in an error that you are passing the wrong class
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question