function DescriptorHelper::describe
Describes an object if supported.
Available options are:
- format: string, the output format name
- raw_text: boolean, sets output type as raw
Throws
InvalidArgumentException when the given format is not supported
File
-
vendor/
symfony/ console/ Helper/ DescriptorHelper.php, line 55
Class
- DescriptorHelper
- This class adds helper method to describe objects in various formats.
Namespace
Symfony\Component\Console\HelperCode
public function describe(OutputInterface $output, ?object $object, array $options = []) : void {
$options = array_merge([
'raw_text' => false,
'format' => 'txt',
], $options);
if (!isset($this->descriptors[$options['format']])) {
throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $options['format']));
}
$descriptor = $this->descriptors[$options['format']];
$descriptor->describe($output, $object, $options);
}