function DebugCommand::dumpSerializerDataForClass
1 call to DebugCommand::dumpSerializerDataForClass()
- DebugCommand::execute in vendor/
symfony/ serializer/ Command/ DebugCommand.php - Executes the current command.
File
-
vendor/
symfony/ serializer/ Command/ DebugCommand.php, line 62
Class
- DebugCommand
- A console command to debug Serializer information.
Namespace
Symfony\Component\Serializer\CommandCode
private function dumpSerializerDataForClass(InputInterface $input, OutputInterface $output, string $class) : void {
$io = new SymfonyStyle($input, $output);
$title = \sprintf('<info>%s</info>', $class);
$rows = [];
$dump = new Dumper($output);
$classMetadata = $this->serializer
->getMetadataFor($class);
foreach ($this->getAttributesData($classMetadata) as $propertyName => $data) {
$rows[] = [
$propertyName,
$dump($data),
];
}
$io->section($title);
if (!$rows) {
$io->text('No Serializer data were found for this class.');
return;
}
$table = new Table($output);
$table->setHeaders([
'Property',
'Options',
]);
$table->setRows($rows);
$table->render();
}