diff --git a/CHANGELOG.md b/CHANGELOG.md index a09b061..4e9c198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ CHANGELOG * PHP 8.4 support * Drop PHP 7 support * Remove MtHAML filter +* Add support for TOML v1.0.0 2.0.0 (2024-02-22) ------------------ diff --git a/composer.json b/composer.json index c3b7737..f363dbb 100644 --- a/composer.json +++ b/composer.json @@ -29,18 +29,18 @@ }, "require-dev": { "ext-json": "*", + "devium/toml": "^1.0", "friendsofphp/php-cs-fixer": "^3.65", "league/commonmark": "^2.0", "nette/neon": "^2.2 || ^3.0", "phpunit/phpunit": "^10.5", "phpstan/phpstan": "^2.0", "symfony/var-dumper": "*", - "twig/twig": "^3.0", - "yosymfony/toml": "^1.0" + "twig/twig": "^3.0" }, "suggest": { - "nette/neon": "If you want to use NEON as front matter", - "yosymfony/toml": "If you want to use TOML as front matter" + "devium/toml": "If you want to use TOML v1.0.0 as front matter", + "nette/neon": "If you want to use NEON as front matter" }, "config": { "sort-packages": true diff --git a/src/Processor/TomlProcessor.php b/src/Processor/TomlProcessor.php index 751b0d3..1835667 100644 --- a/src/Processor/TomlProcessor.php +++ b/src/Processor/TomlProcessor.php @@ -12,13 +12,17 @@ namespace Webuni\FrontMatter\Processor; -use Yosymfony\Toml\Toml; +use Devium\Toml\Toml; +use Devium\Toml\TomlError; final class TomlProcessor implements ProcessorInterface { + /** + * @throws TomlError + */ public function parse(string $string): array { - return (array) Toml::parse($string); + return (array) Toml::decode($string); } public function dump(array $data): string