public static function file($file) { if (!file_exists($file)) { return array(); } return TomlParser::fromFile($file); }
public function load($filename) { if (!class_exists('Toml\\Parser')) { throw new \RuntimeException('Unable to read toml as the Toml Parser is not installed.'); } $config = Parser::fromFile($filename); return $config ?: array(); }
/** * @param string $data * * @return mixed * @throws Exception\TomlThawException */ public function thaw($data) { try { $value = Parser::fromString($data); } catch (Exception $e) { throw new Exception\TomlThawException($e); } return $value; }
/** * * @param string $path * @param array $options * @return FixtureCollection */ public function load($path, array $options = array()) { $data = Parser::fromFile($path); return FixtureCollection::create($data); }
public function parse($content) { return Toml::fromString($content); }
/** * Deserializes Frontmatter data in the Toml format. * * @param string $data * * @return object */ public function deserialize($data) { return Parser::fromString($data); }