Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[Console] Add dumper #28898
This PR adds a new
For the latter we cannot use the global system (debug) dumper, i.e.
$io = new SymfonyStyle($input, $output); $dumper = new Dumper($io); $io->writeln($dumper([-0.5, 0, 1])); $io->writeln($dumper(new \stdClass())); $io->writeln($dumper(123)); $io->writeln($dumper('foo')); $io->writeln($dumper(null)); $io->writeln($dumper(true));
With VarDumper comonent:
Now we can :)
2 times, most recently
Oct 20, 2018
referenced this pull request
Oct 27, 2018
I already thought about something like that. IMHO the issue is somewhere else.
This PR solves this this issue only in CLI, and only in the main entry point (the Command class).
So here we go: Many other framework / language have a
Also there might be e.g. "debug-commands" with lots of code / output control. My main goal here was to obtain the dump value so i can put it in a console table, and have DX friendly output (#24208, #27684)
Im not sure using the logger is possible in my case, im looking mostly for
So maybe get rid of
True, if we get rid of
In that case putting it in VarDumper might be a better place
edit: no, if we move it to vardumper we dont need fallback support :D the whole idea was to NOT require var-dumper, but use it if available.
i dont understand the failures yet, running a single test works as expected (
In this case
var_dump( class_exists::class, class_exists(CliDumper::class), \Symfony\Component\Console\Helper\class_exists(CliDumper::class), class_exists(CliDumper::class) ); // Symfony\Component\Console\Helper\class_exists" // bool(true) <-- unexpected // bool(false) // bool(false)
edit: i've split the tests for now into 2 individual suites, this seems to overcome the state issue.