ParserYaml.php

  1. 8.0.x lib/Drush/Make/Parser/ParserYaml.php
  2. 7.x lib/Drush/Make/Parser/ParserYaml.php
  3. master lib/Drush/Make/Parser/ParserYaml.php

Parser for YAML format.

Namespace

Drush\Make\Parser

Classes

Namesort descending Description
ParserYaml

File

lib/Drush/Make/Parser/ParserYaml.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Parser for YAML format.
  5. */
  6. namespace Drush\Make\Parser;
  7. use Symfony\Component\Yaml\Yaml;
  8. class ParserYaml implements ParserInterface {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public static function supportedFile($filename) {
  13. $info = pathinfo($filename);
  14. return isset($info['extension']) && $info['extension'] === 'yml';
  15. }
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public static function parse($data) {
  20. return Yaml::parse($data);
  21. }
  22. }