mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
upgrade php-cs 3.49
This commit is contained in:
@@ -138,7 +138,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setObject(StoredObject $object = null)
|
||||
public function setObject(?StoredObject $object = null)
|
||||
{
|
||||
$this->object = $object;
|
||||
|
||||
|
@@ -17,10 +17,10 @@ interface GenericDocForAccompanyingPeriodProviderInterface
|
||||
{
|
||||
public function buildFetchQueryForAccompanyingPeriod(
|
||||
AccompanyingPeriod $accompanyingPeriod,
|
||||
\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;
|
||||
|
||||
/**
|
||||
|
@@ -17,10 +17,10 @@ interface GenericDocForPersonProviderInterface
|
||||
{
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@@ -43,9 +43,9 @@ final readonly class Manager
|
||||
*/
|
||||
public function countDocForAccompanyingPeriod(
|
||||
AccompanyingPeriod $accompanyingPeriod,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
array $places = []
|
||||
): int {
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
||||
@@ -73,9 +73,9 @@ final readonly class Manager
|
||||
|
||||
public function countDocForPerson(
|
||||
Person $person,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
array $places = []
|
||||
): int {
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
||||
@@ -94,9 +94,9 @@ final readonly class Manager
|
||||
AccompanyingPeriod $accompanyingPeriod,
|
||||
int $offset = 0,
|
||||
int $limit = 20,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
array $places = []
|
||||
): iterable {
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
||||
@@ -137,9 +137,9 @@ final readonly class Manager
|
||||
Person $person,
|
||||
int $offset = 0,
|
||||
int $limit = 20,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
array $places = []
|
||||
): iterable {
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
||||
@@ -183,9 +183,9 @@ final readonly class Manager
|
||||
*/
|
||||
private function buildUnionQuery(
|
||||
AccompanyingPeriod|Person $linked,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null,
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null,
|
||||
array $places = [],
|
||||
): array {
|
||||
$queries = [];
|
||||
|
@@ -34,7 +34,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -59,7 +59,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);
|
||||
|
||||
@@ -108,7 +108,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);
|
||||
|
||||
|
@@ -32,10 +32,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 +50,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);
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ class AccompanyingCourseDocumentRepository implements ObjectRepository
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
|
||||
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class DocumentCategoryRepository implements ObjectRepository
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
|
||||
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -48,14 +48,14 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
|
||||
return $qb;
|
||||
}
|
||||
|
||||
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface
|
||||
public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
||||
{
|
||||
$query = $this->buildBaseFetchQueryForPerson($person, $startDate, $endDate, $content);
|
||||
|
||||
return $this->addFetchQueryByPersonACL($query, $person);
|
||||
}
|
||||
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $period, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
||||
{
|
||||
$personDocMetadata = $this->em->getClassMetadata(PersonDocument::class);
|
||||
$participationMetadata = $this->em->getClassMetadata(AccompanyingPeriodParticipation::class);
|
||||
@@ -114,7 +114,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
|
||||
return $this->addFilterClauses($query, $startDate, $endDate, $content);
|
||||
}
|
||||
|
||||
public function buildBaseFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||
public function buildBaseFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
||||
{
|
||||
$personDocMetadata = $this->em->getClassMetadata(PersonDocument::class);
|
||||
|
||||
@@ -134,7 +134,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
|
||||
return $this->addFilterClauses($query, $startDate, $endDate, $content);
|
||||
}
|
||||
|
||||
private function addFilterClauses(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||
private function addFilterClauses(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
||||
{
|
||||
$personDocMetadata = $this->em->getClassMetadata(PersonDocument::class);
|
||||
|
||||
|
@@ -29,15 +29,15 @@ interface PersonDocumentACLAwareRepositoryInterface
|
||||
|
||||
public function buildFetchQueryForPerson(
|
||||
Person $person,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null
|
||||
): FetchQueryInterface;
|
||||
|
||||
public function buildFetchQueryForAccompanyingPeriod(
|
||||
AccompanyingPeriod $period,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null
|
||||
): FetchQueryInterface;
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ readonly class PersonDocumentRepository implements ObjectRepository
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
|
||||
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null)
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null)
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ final class StoredObjectRepository implements ObjectRepository
|
||||
*
|
||||
* @return array<int, StoredObject>
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
|
||||
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
@@ -136,13 +136,13 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{small: boolean} $options
|
||||
* @param array{small: bool} $options
|
||||
*
|
||||
* @throws \Twig\Error\LoaderError
|
||||
* @throws \Twig\Error\RuntimeError
|
||||
* @throws \Twig\Error\SyntaxError
|
||||
*/
|
||||
public function renderButtonGroup(Environment $environment, StoredObject $document, string $title = null, bool $canEdit = true, array $options = []): string
|
||||
public function renderButtonGroup(Environment $environment, StoredObject $document, ?string $title = null, bool $canEdit = true, array $options = []): string
|
||||
{
|
||||
return $environment->render(self::TEMPLATE_BUTTON_GROUP, [
|
||||
'document' => $document,
|
||||
@@ -153,7 +153,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
|
||||
]);
|
||||
}
|
||||
|
||||
public function renderEditButton(Environment $environment, StoredObject $document, array $options = null): string
|
||||
public function renderEditButton(Environment $environment, StoredObject $document, ?array $options = null): string
|
||||
{
|
||||
return $environment->render(self::TEMPLATE, [
|
||||
'document' => $document,
|
||||
|
@@ -174,7 +174,7 @@ class ManagerTest extends KernelTestCase
|
||||
|
||||
final readonly class SimpleGenericDocAccompanyingPeriodProvider implements GenericDocForAccompanyingPeriodProviderInterface
|
||||
{
|
||||
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
|
||||
{
|
||||
$query = new FetchQuery(
|
||||
'accompanying_course_document_dummy',
|
||||
@@ -196,7 +196,7 @@ final readonly class SimpleGenericDocAccompanyingPeriodProvider implements Gener
|
||||
|
||||
final readonly class SimpleGenericDocPersonProvider implements GenericDocForPersonProviderInterface
|
||||
{
|
||||
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
|
||||
{
|
||||
$query = new FetchQuery(
|
||||
'dummy_person_doc',
|
||||
|
@@ -40,7 +40,7 @@ class AccompanyingCourseDocumentGenericDocProviderTest extends KernelTestCase
|
||||
/**
|
||||
* @dataProvider provideSearchArguments
|
||||
*/
|
||||
public function testWithoutAnyArgument(?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, string $content = null): void
|
||||
public function testWithoutAnyArgument(?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?string $content = null): void
|
||||
{
|
||||
$period = $this->entityManager->createQuery('SELECT a FROM '.AccompanyingPeriod::class.' a')
|
||||
->setMaxResults(1)
|
||||
|
@@ -53,7 +53,7 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
* @throws \Doctrine\ORM\NoResultException
|
||||
* @throws \Doctrine\ORM\NonUniqueResultException
|
||||
*/
|
||||
public function testBuildFetchQueryForPerson(\DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): void
|
||||
public function testBuildFetchQueryForPerson(?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): void
|
||||
{
|
||||
$centerManager = $this->prophesize(CenterResolverManagerInterface::class);
|
||||
$centerManager->resolveCenters(Argument::type(Person::class))
|
||||
@@ -92,9 +92,9 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
*/
|
||||
public function testBuildFetchQueryForAccompanyingPeriod(
|
||||
AccompanyingPeriod $period,
|
||||
\DateTimeImmutable $startDate = null,
|
||||
\DateTimeImmutable $endDate = null,
|
||||
string $content = null
|
||||
?\DateTimeImmutable $startDate = null,
|
||||
?\DateTimeImmutable $endDate = null,
|
||||
?string $content = null
|
||||
): void {
|
||||
$centerManager = $this->prophesize(CenterResolverManagerInterface::class);
|
||||
$centerManager->resolveCenters(Argument::type(Person::class))
|
||||
|
@@ -90,7 +90,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
/**
|
||||
* @dataProvider getDataProvider
|
||||
*/
|
||||
public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, string $exceptionClass = null)
|
||||
public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null)
|
||||
{
|
||||
if (null !== $exceptionClass) {
|
||||
$this->expectException($exceptionClass);
|
||||
@@ -104,7 +104,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
/**
|
||||
* @dataProvider getDataProvider
|
||||
*/
|
||||
public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, string $exceptionClass = null)
|
||||
public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null)
|
||||
{
|
||||
if (null !== $exceptionClass) {
|
||||
$this->expectException($exceptionClass);
|
||||
|
Reference in New Issue
Block a user