跳至正文

更新日志 0.8.0 — 2022 年 5 月 9 日

重要变更

浮点值处理

允许使用浮点值,如下所示:

class Foo
{
    /** @var 404.42|1337.42 */
    public readonly float $value;
}

文字布尔true / false值处理

感谢@danog 提供此功能!

允许使用布尔值,如下所示:

class Foo
{
    /** @var int|false */
    public readonly int|bool $value;
}

对象处理联合的类字符串

允许在class-string中声明多个类名:

class Foo
{
    /** @var class-string<SomeClass|SomeOtherClass> */
    public readonly string $className;
}

允许在文档块中使用psalm和phpstan前缀

感谢@boesing 提供此功能!

现在可以正确处理以下注释: @psalm-param 、 @phpstan-param 、 @psalm-return和@phpstan-return 。

如果其中之一与基本@param或@return注释一起找到,它将优先于基本值。

新功能

  • 允许在 docblocks 中使用psalm和phpstan前缀 ( 64e0a2 )
  • 处理对象联合的类字符串( b7923b )
  • 在函数定义中处理文件名( 0b042b )
  • 处理浮点值类型( 790df8 )
  • 处理文字布尔true / false类型 ( afcedf )
  • 引入复合类型( 892f38 )

错误修复

  • 仅当值被接受时才调用值更改函数( 2f08e1 )
  • 文件修改时处理函数定义缓存失效( 511a0d )

其他

  • 添加 Composer 允许的插件的配置 ( 2f310c )
  • 将 Psalm 配置文件添加到.gitattributes ( 979272 )
  • 增强开发依赖性 ( 844384 )
  • 在文档块中声明代码类型( 03c84a )
  • 忽略Polyfill覆盖 ( c08fe5 )
  • 删除symfony/polyfill-php80依赖项 ( 368737 )