跳至正文

更新日志 1.4.0 — 2023 年 4 月 17 日

重要变更

源无效时抛出异常

提供给源的 JSON 或 YAML 可能无效,在这种情况下,现在可以捕获和操作异常。

try {
    $source = \CuyZ\Valinor\Mapper\Source\Source::json('invalid JSON');
} catch (\CuyZ\Valinor\Mapper\Source\Exception\InvalidSource $error) {
    // Let the application handle the exception in the desired way.
    // It is possible to get the original source with `$error->source()`
}

新功能

  • 引入使用无效 JSON/YAML 时抛出的InvalidSource ( 0739d1 )

错误修复

  • 允许浮点类型的整数值 ( c6df24 )
  • 使array-key类型mixed匹配( ccebf7 )
  • 当类具有同名父类时防止无限循环( 83eb05 )

其他

  • 在各种自定义异常中添加先前的异常( b9e381 )