0
votes

I'm developing some REST APIS and the dump function stopped working in my dev env, it doesn't show any information about anything or return the usual output

I tried to debug using the dump() function (from the /vendor/symfony/var-dumper/Resources/functions/dump.php file) and the \Symfony\Component\VarDumper\VarDumper::dump() function with the same results: it doesn't show anything or throw a php exception.

Also, i've tried both: use the regular debug commands (i.e bin/console config:dump-reference) and reinstall the debug-bundle

In this example my program returns a notification: Array to string conversion

$foo = array("asdads", "czxcxzc");
dump($foo);

In this other example the response is null

$foo = "bar";
dump($foo);

I just need the regular output for this function: is really useful to debug and see whats going on with my program

1
What is exactly your problem ? Can you add some code/examples ?Jérôme
i've just added some code examples, and tried to be a lil more specific with the problem (srry, kinda noob)Enrique Nuñez Malledo
are you in dev environment?Arleigh Hix
Yup, i am on my dev envEnrique Nuñez Malledo
Do you have a config/packages/debug.yaml file? if so, please post itArleigh Hix

1 Answers

0
votes

I think that i've figure this out.

The problem was that i've added the __destruct() method on my main controller class (App\Controller)

App\Controller

abstract class Controller implements ContainerAwareInterface
{

use ContainerAwareTrait;
use ControllerTrait;    
...
public function __destruct()
{
   //Some stuffs here
}

I dont know why, but this method avoids loading for some of these debug methods (maybe some other features, but not sure about it)

The solution (for now) was moving this __destruct() method to my app main controller. Now everything works like a charm