Remove obsolete documentation, fix typing here and there.

This commit is contained in:
Pol Dellaiera 2021-05-21 16:34:42 +02:00
parent 220f1ea0eb
commit d672a29dda
14 changed files with 25 additions and 181 deletions

View File

@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Comment|null find($id, $lockMode = null, $lockVersion = null)
* @method Comment|null findOneBy(array $criteria, array $orderBy = null)
* @method Comment[] findAll()
* @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class CommentRepository
{
private EntityRepository $repository;

View File

@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Origin|null find($id, $lockMode = null, $lockVersion = null)
* @method Origin|null findOneBy(array $criteria, array $orderBy = null)
* @method Origin[] findAll()
* @method Origin[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class OriginRepository
{
private EntityRepository $repository;

View File

@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method AccompanyingPeriodParticipation|null find($id, $lockMode = null, $lockVersion = null)
* @method AccompanyingPeriodParticipation|null findOneBy(array $criteria, array $orderBy = null)
* @method AccompanyingPeriodParticipation[] findAll()
* @method AccompanyingPeriodParticipation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class AccompanyingPeriodParticipationRepository
{
private EntityRepository $repository;

View File

@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method AccompanyingPeriod|null find($id, $lockMode = null, $lockVersion = null)
* @method AccompanyingPeriod|null findOneBy(array $criteria, array $orderBy = null)
* @method AccompanyingPeriod[] findAll()
* @method AccompanyingPeriod[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class AccompanyingPeriodRepository
{
private EntityRepository $repository;

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\Household\HouseholdMembers;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method HouseholdMembers|null find($id, $lockMode = null, $lockVersion = null)
* @method HouseholdMembers|null findOneBy(array $criteria, array $orderBy = null)
* @method HouseholdMembers[] findAll()
* @method HouseholdMembers[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class HouseholdMembersRepository
{
private EntityRepository $repository;
@ -20,33 +14,4 @@ final class HouseholdMembersRepository
{
$this->repository = $entityManager->getRepository(HouseholdMembers::class);
}
// /**
// * @return HouseholdMembers[] Returns an array of HouseholdMembers objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->orderBy('h.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?HouseholdMembers
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\Household\Household;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Household|null find($id, $lockMode = null, $lockVersion = null)
* @method Household|null findOneBy(array $criteria, array $orderBy = null)
* @method Household[] findAll()
* @method Household[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class HouseholdRepository
{
private EntityRepository $repository;
@ -20,33 +14,4 @@ final class HouseholdRepository
{
$this->repository = $entityManager->getRepository(Household::class);
}
// /**
// * @return Household[] Returns an array of Household objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->orderBy('h.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Household
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\PersonAltName;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* PersonAltNameRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
final class PersonAltNameRepository
{
private EntityRepository $repository;

View File

@ -7,11 +7,6 @@ use Chill\PersonBundle\Entity\PersonNotDuplicate;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* Class PersonNotDuplicateRepository
*
* @package Chill\PersonBundle\Repository
*/
final class PersonNotDuplicateRepository
{
private EntityRepository $repository;
@ -21,12 +16,7 @@ final class PersonNotDuplicateRepository
$this->repository = $entityManager->getRepository(PersonNotDuplicate::class);
}
/**
* @param \Chill\PersonBundle\Entity\Person $person
*
* @return array
*/
public function findNotDuplicatePerson(Person $person)
public function findNotDuplicatePerson(Person $person): array
{
$qb = $this->repository->createQueryBuilder('pnd');
$qb->select('pnd')
@ -36,6 +26,7 @@ final class PersonNotDuplicateRepository
$result = $qb->getQuery()->getResult();
$persons = [];
foreach ($result as $row) {
if ($row->getPerson1() === $person) {
$persons[] = $row->getPerson2();

View File

@ -32,17 +32,15 @@ final class PersonRepository
$this->repository = $entityManager->getRepository(Person::class);
}
public function find($id, $lockMode = null, $lockVersion = null)
public function find($id, $lockMode = null, $lockVersion = null): ?Person
{
return $this->repository->find($id, $lockMode, $lockVersion);
}
/**
* @param string $phonenumber
* @param $centers
* @param $firstResult
* @param $maxResults
* @param array $only
* @return mixed
* @throws \Exception
*/
@ -67,10 +65,7 @@ final class PersonRepository
}
/**
* @param string $phonenumber
* @param $centers
* @param array $only
* @return int
* @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException
*/
@ -78,8 +73,7 @@ final class PersonRepository
string $phonenumber,
$centers,
array $only = ['mobile', 'phone']
): int
{
): int {
$qb = $this->repository->createQueryBuilder('p');
$qb->select('COUNT(p)');
@ -90,12 +84,9 @@ final class PersonRepository
}
/**
* @param QueryBuilder $qb
* @param string $phonenumber
* @param array $only
* @throws \Exception
*/
protected function addPhoneNumber(QueryBuilder $qb, string $phonenumber, array $only)
protected function addPhoneNumber(QueryBuilder $qb, string $phonenumber, array $only): void
{
if (count($only) === 0) {
throw new \Exception("No array field to search");
@ -117,20 +108,12 @@ final class PersonRepository
$qb->setParameter('phonenumber', '%'.$phonenumber.'%');
}
/**
* @param $phonenumber
* @return string
*/
protected function parsePhoneNumber($phonenumber): string
protected function parsePhoneNumber(string $phonenumber): string
{
return \str_replace(' ', '', $phonenumber);
}
/**
* @param QueryBuilder $qb
* @param array $centers
*/
protected function addByCenters(QueryBuilder $qb, array $centers)
protected function addByCenters(QueryBuilder $qb, array $centers): void
{
if (count($centers) > 0) {
$qb->andWhere($qb->expr()->in('p.center', ':centers'));

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Evaluation|null find($id, $lockMode = null, $lockVersion = null)
* @method Evaluation|null findOneBy(array $criteria, array $orderBy = null)
* @method Evaluation[] findAll()
* @method Evaluation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class EvaluationRepository
{
private EntityRepository $repository;

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Goal;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Goal|null find($id, $lockMode = null, $lockVersion = null)
* @method Goal|null findOneBy(array $criteria, array $orderBy = null)
* @method Goal[] findAll()
* @method Goal[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class GoalRepository
{
private EntityRepository $repository;

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Result;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method Result|null find($id, $lockMode = null, $lockVersion = null)
* @method Result|null findOneBy(array $criteria, array $orderBy = null)
* @method Result[] findAll()
* @method Result[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class ResultRepository
{
private EntityRepository $repository;

View File

@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method SocialAction|null find($id, $lockMode = null, $lockVersion = null)
* @method SocialAction|null findOneBy(array $criteria, array $orderBy = null)
* @method SocialAction[] findAll()
* @method SocialAction[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class SocialActionRepository
{
private EntityRepository $repository;

View File

@ -7,12 +7,6 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
/**
* @method SocialIssue|null find($id, $lockMode = null, $lockVersion = null)
* @method SocialIssue|null findOneBy(array $criteria, array $orderBy = null)
* @method SocialIssue[] findAll()
* @method SocialIssue[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
final class SocialIssueRepository
{
private EntityRepository $repository;