DescriptorHelper.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\FrameworkBundle\Console\Helper;
  11. use Symfony\Bundle\FrameworkBundle\Console\Descriptor\JsonDescriptor;
  12. use Symfony\Bundle\FrameworkBundle\Console\Descriptor\MarkdownDescriptor;
  13. use Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor;
  14. use Symfony\Bundle\FrameworkBundle\Console\Descriptor\XmlDescriptor;
  15. use Symfony\Component\Console\Helper\DescriptorHelper as BaseDescriptorHelper;
  16. use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
  17. /**
  18. * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  19. *
  20. * @internal
  21. */
  22. class DescriptorHelper extends BaseDescriptorHelper
  23. {
  24. public function __construct(FileLinkFormatter $fileLinkFormatter = null)
  25. {
  26. $this
  27. ->register('txt', new TextDescriptor($fileLinkFormatter))
  28. ->register('xml', new XmlDescriptor())
  29. ->register('json', new JsonDescriptor())
  30. ->register('md', new MarkdownDescriptor())
  31. ;
  32. }
  33. }