<?php

namespace AppBundle\Repository;

use AppBundle\Entity\FennecUser;
use Doctrine\ORM\EntityRepository;

/**
 * WebuserDataRepository
 *
 * This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom
 * repository methods below.
 */
class WebuserDataRepository extends EntityRepository
{
    public function getNumberOfProjects(FennecUser $user = null): int{
        if ($user === null) {
            return 0;
        }

        return $this->findBy(['webuser' => $user])->count();
    }
}

<?php

namespace AppBundle\Repository;

use AppBundle\Entity\FennecUser;
use Doctrine\ORM\EntityRepository;

/**
 * WebuserDataRepository
 *
 * This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom
 * repository methods below.
 */
class WebuserDataRepository extends EntityRepository
{
    public function getNumberOfProjects(FennecUser $user = null): int{
        if ($user === null) {
            return 0;
        }

        return count($this->findBy(['webuser' => $user]));
    }
}

Fix wrong call of count method
Fix wrong call of count method
