SoftDeletingScope.php line 55: count(): Parameter must be... 报错的解决方法

Spoony 57.25m2023-08-10283 次点击
This shouldn't be affecting 5.5 for what I've tested. We have tests for soft deleting feature (e.g. DatabaseSoftDeletingScopeTest and DatabaseSoftDeletingTraitTest) and the Continuous Integration builds for PHP 7.2 aren't failing: https://travis-ci.org/laravel/framework/builds

Note that this same line of SoftDeletingScope has already been fixed: https://github.com/laravel/framework/blob/5.5/src/Illuminate/Database/Eloquent/SoftDeletingScope.php#L55 Going back in time we can see that this was fixed in 5.4 after merging PR #20258. 😉

----

I solved by changing "$originalWhereCount = count($query->wheres);" for "$originalWhereCount = is_null($query->wheres)
? 0 : count($query->wheres);" in the function "callScope(callable $scope, $parameters = [])" in the file "/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php"

https://github.com/laravel/framework/issues/22162
收藏 ♥ 感谢
暂无回复

登录注册 后可回复。



GitHub