Merge pull request #28906 from PaddleHQ/5.2

[5.2] Avoid counting nulls (fatal in PHP 7.2)
This commit is contained in:
Taylor Otwell 2019-06-21 15:17:51 +02:00 committed by GitHub
commit c69fc5d604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -1228,7 +1228,7 @@ class Builder
*/
protected function shouldNestWheresForScope(QueryBuilder $query, $originalWhereCount)
{
return count($query->wheres) > $originalWhereCount;
return count((array) $query->wheres) > $originalWhereCount;
}
/**

View File

@ -52,7 +52,7 @@ class SoftDeletingScope implements Scope
*/
protected function getDeletedAtColumn(Builder $builder)
{
if (count($builder->getQuery()->joins) > 0) {
if (count((array) $builder->getQuery()->joins) > 0) {
return $builder->getModel()->getQualifiedDeletedAtColumn();
} else {
return $builder->getModel()->getDeletedAtColumn();

View File

@ -769,7 +769,7 @@ class Builder
*/
public function addNestedWhereQuery($query, $boolean = 'and')
{
if (count($query->wheres)) {
if (count((array) $query->wheres)) {
$type = 'Nested';
$this->wheres[] = compact('type', 'query', 'boolean');