mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -20,7 +20,6 @@ use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
@@ -34,7 +33,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
private EntityManagerInterface $entityManager,
|
||||
) {}
|
||||
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||
{
|
||||
$classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class);
|
||||
|
||||
@@ -42,7 +41,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
self::KEY,
|
||||
sprintf('jsonb_build_object(\'id\', %s)', $classMetadata->getIdentifierColumnNames()[0]),
|
||||
$classMetadata->getColumnName('date'),
|
||||
$classMetadata->getSchemaName() . '.' . $classMetadata->getTableName()
|
||||
$classMetadata->getSchemaName().'.'.$classMetadata->getTableName()
|
||||
);
|
||||
|
||||
$query->addWhereClause(
|
||||
@@ -59,7 +58,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
return $this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod);
|
||||
}
|
||||
|
||||
public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
||||
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||
{
|
||||
$classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class);
|
||||
|
||||
@@ -67,7 +66,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
self::KEY,
|
||||
sprintf('jsonb_build_object(\'id\', %s)', $classMetadata->getIdentifierColumnNames()[0]),
|
||||
$classMetadata->getColumnName('date'),
|
||||
$classMetadata->getSchemaName() . '.' . $classMetadata->getTableName() . ' AS acc_course_document'
|
||||
$classMetadata->getSchemaName().'.'.$classMetadata->getTableName().' AS acc_course_document'
|
||||
);
|
||||
|
||||
$atLeastOne = false;
|
||||
@@ -98,7 +97,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
return $query;
|
||||
}
|
||||
|
||||
$query->addWhereClause('(' . implode(' OR ', $or) . ')', $orParams, $orTypes);
|
||||
$query->addWhereClause('('.implode(' OR ', $or).')', $orParams, $orTypes);
|
||||
|
||||
return $this->addWhereClause($query, $startDate, $endDate, $content);
|
||||
}
|
||||
@@ -108,7 +107,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person);
|
||||
}
|
||||
|
||||
private function addWhereClause(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
||||
private function addWhereClause(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||
{
|
||||
$classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class);
|
||||
|
||||
@@ -135,7 +134,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
$classMetadata->getColumnName('title'),
|
||||
$classMetadata->getColumnName('description')
|
||||
),
|
||||
['%' . $content . '%', '%' . $content . '%'],
|
||||
['%'.$content.'%', '%'.$content.'%'],
|
||||
[Types::STRING, Types::STRING]
|
||||
);
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ use Chill\DocStoreBundle\Repository\PersonDocumentACLAwareRepositoryInterface;
|
||||
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final readonly class PersonDocumentGenericDocProvider implements GenericDocForPersonProviderInterface, GenericDocForAccompanyingPeriodProviderInterface
|
||||
@@ -32,10 +31,10 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
|
||||
|
||||
public function buildFetchQueryForPerson(
|
||||
Person $person,
|
||||
?DateTimeImmutable $startDate = null,
|
||||
?DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
?string $origin = null
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
string $origin = null
|
||||
): FetchQueryInterface {
|
||||
return $this->personDocumentACLAwareRepository->buildFetchQueryForPerson(
|
||||
$person,
|
||||
@@ -50,7 +49,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
|
||||
return $this->security->isGranted(PersonDocumentVoter::SEE, $person);
|
||||
}
|
||||
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||
{
|
||||
return $this->personDocumentACLAwareRepository->buildFetchQueryForAccompanyingPeriod($accompanyingPeriod, $startDate, $endDate, $content);
|
||||
}
|
||||
|
Reference in New Issue
Block a user