XmlDescriptor example



namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;

use Symfony\Bundle\FrameworkBundle\Console\Descriptor\XmlDescriptor;

class XmlDescriptorTest extends AbstractDescriptorTestCase
{
    protected static function getDescriptor()
    {
        return new XmlDescriptor();
    }

    protected static function getFormat()
    {
        return 'xml';
    }
}
class DescriptorHelper extends Helper
{
    /** * @var DescriptorInterface[] */
    private array $descriptors = [];

    public function __construct()
    {
        $this
            ->register('txt', new TextDescriptor())
            ->register('xml', new XmlDescriptor())
            ->register('json', new JsonDescriptor())
            ->register('md', new MarkdownDescriptor())
            ->register('rst', new ReStructuredTextDescriptor())
        ;
    }

    /** * Describes an object if supported. * * Available options are: * * format: string, the output format name * * raw_text: boolean, sets output type as raw * * @return void * * @throws InvalidArgumentException when the given format is not supported */


namespace Symfony\Component\Console\Tests\Descriptor;

use Symfony\Component\Console\Descriptor\XmlDescriptor;

class XmlDescriptorTest extends AbstractDescriptorTestCase
{
    protected function getDescriptor()
    {
        return new XmlDescriptor();
    }

    protected static function getFormat()
    {
        return 'xml';
    }
}
/** * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> * * @internal */
class DescriptorHelper extends BaseDescriptorHelper
{
    public function __construct(FileLinkFormatter $fileLinkFormatter = null)
    {
        $this
            ->register('txt', new TextDescriptor($fileLinkFormatter))
            ->register('xml', new XmlDescriptor())
            ->register('json', new JsonDescriptor())
            ->register('md', new MarkdownDescriptor())
        ;
    }
}
class DescriptorHelper extends Helper
{
    /** * @var DescriptorInterface[] */
    private array $descriptors = [];

    public function __construct()
    {
        $this
            ->register('txt', new TextDescriptor())
            ->register('xml', new XmlDescriptor())
            ->register('json', new JsonDescriptor())
            ->register('md', new MarkdownDescriptor())
            ->register('rst', new ReStructuredTextDescriptor())
        ;
    }

    /** * Describes an object if supported. * * Available options are: * * format: string, the output format name * * raw_text: boolean, sets output type as raw * * @return void * * @throws InvalidArgumentException when the given format is not supported */
Home | Imprint | This part of the site doesn't use cookies.