for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Noodlehaus\Parser;
use Noodlehaus\Exception\ParseException;
use Yosymfony\Toml\Toml as TomlParser;
/**
* TOML parser
*
* @package Config
* @author Jesus A. Domingo <[email protected]>
* @author Hassan Khan <[email protected]>
* @author Filip Š <[email protected]>
* @link https://github.com/noodlehaus/config
* @license MIT
*/
class Toml implements ParserInterface
{
* {@inheritDoc}
public static function getSupportedExtensions()
return ['toml'];
}
* Loads a TOML file as an array
* @throws ParseException If there is an error parsing the TOML file
public function parseFile($filename)
try {
return TomlParser::parseFile($filename);
} catch (\Exception $exception) {
throw new ParseException(
[
'message' => 'Error parsing TOML file',
'exception' => $exception,
]
);
* Loads a TOML string as an array
* @throws ParseException If there is an error parsing the TOML string
public function parseString($config)
return TomlParser::parse($config);
'message' => 'Error parsing TOML string',