cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,9 +1,17 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\DataFixtures\Helper;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
use function random_int;
trait RandomPersonHelperTrait
{
@@ -13,23 +21,20 @@ trait RandomPersonHelperTrait
{
$qb = $em->createQueryBuilder();
$qb
->from(Person::class, 'p')
;
->from(Person::class, 'p');
if (null === $this->nbOfPersons) {
$this->nbOfPersons = $qb
->select('COUNT(p)')
->getQuery()
->getSingleScalarResult()
;
->getSingleScalarResult();
}
return $qb
->select('p')
->setMaxResults(1)
->setFirstResult(\random_int(0, $this->nbOfPersons))
->setFirstResult(random_int(0, $this->nbOfPersons))
->getQuery()
->getSingleResult()
;
->getSingleResult();
}
}