+ const PARSE_CUSTOM_TAGS = 512;
+ const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
+
+ /**
+ * @deprecated since version 3.4, to be removed in 4.0. Quote your evaluable keys instead.
+ */
+ const PARSE_KEYS_AS_STRINGS = 2048;
+
+ /**
+ * Parses a YAML file into a PHP value.
+ *
+ * Usage:
+ *
+ * $array = Yaml::parseFile('config.yml');
+ * print_r($array);
+ *
+ * @param string $filename The path to the YAML file to be parsed
+ * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
+ *
+ * @return mixed The YAML converted to a PHP value
+ *
+ * @throws ParseException If the file could not be read or the YAML is not valid
+ */
+ public static function parseFile($filename, $flags = 0)
+ {
+ $yaml = new Parser();
+
+ return $yaml->parseFile($filename, $flags);
+ }