无法调用类字符串或对象上的 toString() 方法。在 HasToString.php:41

作者: pscheit创建于 2025年7月26日更新于 2025年7月26日
php
    protected function featureValueOf($actual)
    {
        if (method_exists($actual, 'toString')) {
            return $actual->toString();
        }

        return (string) $actual;
    }
这个错误由 phpstan 检测到,并且已在 #88 中写入基准中

内容来源: hamcrest/hamcrest-php