Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'minimum_number_of_parameters' => 2,
],
'type_declaration_spaces' => true,
'nullable_type_declaration_for_default_null_value' => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php-cs-fixer.cache')
Expand Down
14 changes: 7 additions & 7 deletions app/config/routing_dev.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
resource: "@WebProfilerBundle/Resources/config/routing/wdt.php"
prefix: /_wdt

_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
resource: "@WebProfilerBundle/Resources/config/routing/profiler.php"
prefix: /_profiler

_errors:
resource: "@FrameworkBundle/Resources/config/routing/errors.xml"
prefix: /_error
resource: "@FrameworkBundle/Resources/config/routing/errors.php"
prefix: /_error

_main:
resource: routing.yml
resource: routing.yml
2 changes: 1 addition & 1 deletion sources/Afup/Association/Cotisations.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public function finProchaineCotisation($cotisation = false): DateTime
* @param string|null $token Token de la facture. Si null, pas de vérification
* @return array
*/
public function getByInvoice(string $invoiceId, string $token = null)
public function getByInvoice(string $invoiceId, ?string $token = null)
{
$requete = 'SELECT';
$requete .= ' * ';
Expand Down
2 changes: 1 addition & 1 deletion sources/Afup/Corporate/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
public function __construct(private FeuilleRepository $feuilleRepository) {}

public function header($url = null, UserInterface $user = null): string
public function header($url = null, ?UserInterface $user = null): string
{
$url = urldecode((string) $url);
$str = '<ul>';
Expand Down
4 changes: 2 additions & 2 deletions sources/Afup/Forum/AppelConferencier.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public function modifierSession(
$blogPostUrl = null,
$interviewUrl = null,
$languageCode = null,
int $skill = null,
int $needs_mentoring = null,
?int $skill = null,
?int $needs_mentoring = null,
$use_markdown = null,
$video_has_fr_subtitles = null,
$video_has_en_subtitles = null,
Expand Down
2 changes: 1 addition & 1 deletion sources/Afup/Utils/SymfonyKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SymfonyKernel
protected ?Request $request;
protected ?Response $response = null;

public function __construct(Request $request = null)
public function __construct(?Request $request = null)
{
$env = 'prod';
$debug = false;
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/Association/Model/CompanyMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public function setLastSubscription(?string $sub): void
}
}

public function hasUpToDateMembershipFee(\DateTimeInterface $now = null): bool
public function hasUpToDateMembershipFee(?\DateTimeInterface $now = null): bool
{
if (!$now instanceof \DateTimeInterface) {
$now = new \DateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getOpenedAt(): ?\DateTime
/**
* @return $this
*/
public function setOpenedAt(\DateTime $openedAt = null): self
public function setOpenedAt(?\DateTime $openedAt = null): self
{
$this->propertyChanged('openedAt', $this->openedAt, $openedAt);
$this->openedAt = $openedAt;
Expand All @@ -119,7 +119,7 @@ public function getClosedAt(): ?\DateTime
/**
* @return $this
*/
public function setClosedAt(\DateTime $closedAt = null): self
public function setClosedAt(?\DateTime $closedAt = null): self
{
$this->propertyChanged('closedAt', $this->closedAt, $closedAt);
$this->closedAt = $closedAt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class TechletterSubscriptionsRepository extends Repository implements MetadataInitializer
{
public function subscribe(User $user = null): void
public function subscribe(?User $user = null): void
{
$subscription = new TechletterSubscription();
$subscription
Expand All @@ -28,7 +28,7 @@ public function subscribe(User $user = null): void
$this->save($subscription);
}

public function hasUserSubscribed(User $user = null)
public function hasUserSubscribed(?User $user = null)
{
if (!$user instanceof User) {
return false;
Expand Down
8 changes: 4 additions & 4 deletions sources/AppBundle/Association/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public function getReminderDate(): ?\DateTime
return $this->reminderDate;
}

public function setReminderDate(\DateTime $reminderDate = null): self
public function setReminderDate(?\DateTime $reminderDate = null): self
{
$this->propertyChanged('reminderDate', $this->reminderDate, $reminderDate);
$this->reminderDate = $reminderDate;
Expand Down Expand Up @@ -553,15 +553,15 @@ public function setLastSubscription(?string $sub): void
}
}

public function hasUpToDateMembershipFee(\DateTimeInterface $now = null): bool
public function hasUpToDateMembershipFee(?\DateTimeInterface $now = null): bool
{
if (!$now instanceof \DateTimeInterface) {
$now = new \DateTime();
}
return $this->getLastSubscription() > $now;
}

public function getDaysBeforeMembershipExpiration(\DateTimeInterface $now = null)
public function getDaysBeforeMembershipExpiration(?\DateTimeInterface $now = null)
{
if (!$now instanceof \DateTimeInterface) {
$now = new \DateTime();
Expand Down Expand Up @@ -670,7 +670,7 @@ public function hasRole($role): bool
return in_array($role, $roles);
}

public function setRoles(array $roles = null): self
public function setRoles(?array $roles = null): self
{
if ($roles === null) {
$roles = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class BankAccountFactory
{
public function createApplyableAt(\DateTimeInterface $applicationDate = null): BankAccount
public function createApplyableAt(?\DateTimeInterface $applicationDate = null): BankAccount
{
$comparisonDate = new \Datetime('2023-01-01');
$comparisonDate->setTime(0, 0, 1);
Expand Down
12 changes: 6 additions & 6 deletions sources/AppBundle/Event/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ public function getDateEndVote()
/**
* @return Event
*/
public function setDateEndVote(DateTime $dateEndVote = null): self
public function setDateEndVote(?DateTime $dateEndVote = null): self
{
$this->propertyChanged('dateEndVote', $this->dateEndVote, $dateEndVote);
$this->dateEndVote = $dateEndVote;
return $this;
}

public function isCfpOpen(DateTime $currentDate = null): bool
public function isCfpOpen(?DateTime $currentDate = null): bool
{
if (!$currentDate instanceof \DateTime) {
$currentDate = new DateTime();
Expand All @@ -278,7 +278,7 @@ public function isCfpOpen(DateTime $currentDate = null): bool
&& $currentDate >= $this->getDateStartCallForPapers();
}

public function isVoteAvailable(DateTime $currentDate = null): bool
public function isVoteAvailable(?DateTime $currentDate = null): bool
{
if (!$currentDate instanceof \DateTime) {
$currentDate = new DateTime();
Expand Down Expand Up @@ -494,7 +494,7 @@ public function getDateEndSpeakersDinerInfosCollection(): ?\DateTime
/**
* @return $this
*/
public function setDateEndSpeakersDinerInfosCollection(DateTime $dateEndSpeakersDinerInfosCollection = null): self
public function setDateEndSpeakersDinerInfosCollection(?DateTime $dateEndSpeakersDinerInfosCollection = null): self
{
$this->propertyChanged('dateEndSpeakersDinerInfosCollection', $this->dateEndSpeakersDinerInfosCollection, $dateEndSpeakersDinerInfosCollection);
$this->dateEndSpeakersDinerInfosCollection = $dateEndSpeakersDinerInfosCollection;
Expand All @@ -513,7 +513,7 @@ public function getDateEndHotelInfosCollection(): ?\DateTime
/**
* @return $this
*/
public function setDateEndHotelInfosCollection(DateTime $dateEndHotelInfosCollection = null): self
public function setDateEndHotelInfosCollection(?DateTime $dateEndHotelInfosCollection = null): self
{
$this->propertyChanged('dateEndHotelInfosCollection', $this->dateEndHotelInfosCollection, $dateEndHotelInfosCollection);
$this->dateEndHotelInfosCollection = $dateEndHotelInfosCollection;
Expand All @@ -540,7 +540,7 @@ public function getDatePlanningAnnouncement(): ?\DateTime
*
* @return $this
*/
public function setDatePlanningAnnouncement(DateTime $datePlanningAnnouncement = null): self
public function setDatePlanningAnnouncement(?DateTime $datePlanningAnnouncement = null): self
{
$this->propertyChanged('datePlanningAnnouncement', $this->datePlanningAnnouncement, $datePlanningAnnouncement);
$this->datePlanningAnnouncement = $datePlanningAnnouncement;
Expand Down
4 changes: 2 additions & 2 deletions sources/AppBundle/Event/Model/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function getPaymentDate(): ?\DateTime
return $this->paymentDate;
}

public function setPaymentDate(\DateTime $paymentDate = null): self
public function setPaymentDate(?\DateTime $paymentDate = null): self
{
$this->propertyChanged('paymentDate', $this->paymentDate, $paymentDate);
$this->paymentDate = $paymentDate;
Expand All @@ -155,7 +155,7 @@ public function getInvoiceDate(): ?\DateTime
return $this->invoiceDate;
}

public function setInvoiceDate(\DateTime $invoiceDate = null): self
public function setInvoiceDate(?\DateTime $invoiceDate = null): self
{
$this->propertyChanged('invoiceDate', $this->invoiceDate, $invoiceDate);
$this->invoiceDate = $invoiceDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
private readonly TalkToSpeakersRepository $talkToSpeakersRepository,
) {}

public function getStats(int $eventId, Datetime $from = null): EventStats
public function getStats(int $eventId, ?Datetime $from = null): EventStats
{
return new EventStats(
$this->getStatsForDay($eventId, self::DAY_ONE, $from),
Expand Down
4 changes: 2 additions & 2 deletions sources/AppBundle/Event/Model/Repository/TalkRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
*/
class TalkRepository extends Repository implements MetadataInitializer
{
public function getNumberOfTalksByEvent(Event|int $event, \DateTime $since = null)
public function getNumberOfTalksByEvent(Event|int $event, ?\DateTime $since = null)
{
return $this->getNumberOfTalksByEventAndLanguage($event, null, $since);
}

public function getNumberOfTalksByEventAndLanguage(Event|int $event, $languageCode = null, \DateTime $since = null)
public function getNumberOfTalksByEventAndLanguage(Event|int $event, $languageCode = null, ?\DateTime $since = null)
{
if ($event instanceof Event) {
$event = $event->getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class TalkToSpeakersRepository extends Repository implements MetadataInitializer
{
public function getNumberOfSpeakers(Event|int $event, \DateTime $since = null)
public function getNumberOfSpeakers(Event|int $event, ?\DateTime $since = null)
{
if ($event instanceof Event) {
$event = $event->getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function getPublicSoldTicketsByDay($day, Event $event)
return $this->getPublicSoldTicketsByDayOfType($event, $day);
}

public function getPublicSoldTicketsByDayOfType(Event $event, $day = null, TicketType $ticketType = null)
public function getPublicSoldTicketsByDayOfType(Event $event, $day = null, ?TicketType $ticketType = null)
{
$sql = '
SELECT COUNT(aif.id) AS sold_tickets
Expand Down Expand Up @@ -161,7 +161,7 @@ public function getPublicSoldTicketsByDayOfType(Event $event, $day = null, Ticke
return $tickets->first()['sold_tickets'];
}

public function getPublicSoldTicketsOfType(Event $event, TicketType $ticketType = null)
public function getPublicSoldTicketsOfType(Event $event, ?TicketType $ticketType = null)
{
return $this->getPublicSoldTicketsByDayOfType($event, null, $ticketType);
}
Expand Down
4 changes: 2 additions & 2 deletions sources/AppBundle/Event/Model/UserBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getBadge(): ?Badge
return $this->badge;
}

public function setBadge(Badge $badge = null): self
public function setBadge(?Badge $badge = null): self
{
$this->badge = $badge;

Expand All @@ -83,7 +83,7 @@ public function getIssuedAt(): ?\DateTime
/**
* @return $this
*/
public function setIssuedAt(\DateTime $issuedAt = null): self
public function setIssuedAt(?\DateTime $issuedAt = null): self
{
$this->propertyChanged('issuedAt', $this->issuedAt, $issuedAt);
$this->issuedAt = $issuedAt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getLatestGeneralAssemblyDate(): ?DateTimeImmutable
return null !== $maxDate ? new DateTimeImmutable('@' . $maxDate) : null;
}

public function hasGeneralMeetingPlanned(DateTimeInterface $currentDate = null): bool
public function hasGeneralMeetingPlanned(?DateTimeInterface $currentDate = null): bool
{
if (!$currentDate instanceof \DateTimeInterface) {
$currentDate = new DateTime();
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/Offices/NullOfficeFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class NullOfficeFinder extends OfficeFinder
{
public function findOffice(Invoice $invoice, User $user = null): ?string
public function findOffice(Invoice $invoice, ?User $user = null): ?string
{
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions sources/AppBundle/Offices/OfficeFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public function __construct(
private readonly AntenneRepository $antenneRepository,
) {}

public function findOffice(Invoice $invoice, User $user = null): ?string
public function findOffice(Invoice $invoice, ?User $user = null): ?string
{
$infos = $this->findInfos($invoice, $user);

return $infos['office'] ?? null;
}

protected function findInfos(Invoice $invoice, User $user = null): array
protected function findInfos(Invoice $invoice, ?User $user = null): array
{
$coordinates = $this->findCoordinates($invoice, $user);

Expand All @@ -54,7 +54,7 @@ protected function findInfos(Invoice $invoice, User $user = null): array
return $infos;
}

protected function findCoordinates(Invoice $invoice, User $user = null): ?Coordinates
protected function findCoordinates(Invoice $invoice, ?User $user = null): ?Coordinates
{
if ($user instanceof User) {
if ($user->getCountry() !== 'FR') {
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/Security/GithubAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
return new RedirectResponse($request->getSession()->get('_security.github_secured_area.target_path'));
}

public function start(Request $request, AuthenticationException $authException = null): RedirectResponse
public function start(Request $request, ?AuthenticationException $authException = null): RedirectResponse
{
return new RedirectResponse($this->router->generate('connection_github'));
}
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/Security/TestGithubAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
return new RedirectResponse($request->getSession()->get('_security.github_secured_area.target_path'));
}

public function start(Request $request, AuthenticationException $authException = null): Response
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
$body = "<h1>Oauth login test</h1>";
foreach (array_keys($this->getTestUsersDetails()) as $name) {
Expand Down
6 changes: 3 additions & 3 deletions sources/AppBundle/Slack/MessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function createMessageForGeneralMeeting(GeneralMeetingRepository $general
return $message;
}

public function createMessageForTicketStats(Event $event, EventStatsRepository $eventStatsRepository, TicketTypeRepository $ticketRepository, \DateTime $date = null): Message
public function createMessageForTicketStats(Event $event, EventStatsRepository $eventStatsRepository, TicketTypeRepository $ticketRepository, ?\DateTime $date = null): Message
{
$eventStats = $eventStatsRepository->getStats((int) $event->getId());
$message = new Message();
Expand Down Expand Up @@ -235,7 +235,7 @@ public function createMessageForTicketStats(Event $event, EventStatsRepository $
}


public function createMessageForCfpStats(Event $event, TalkRepository $talkRepository, TalkToSpeakersRepository $talkToSpeakersRepository, \DateTime $currentDate, \DateTime $since = null): Message
public function createMessageForCfpStats(Event $event, TalkRepository $talkRepository, TalkToSpeakersRepository $talkToSpeakersRepository, \DateTime $currentDate, ?\DateTime $since = null): Message
{
$message = new Message();
$message
Expand Down Expand Up @@ -291,7 +291,7 @@ public function createMessageForCfpStats(Event $event, TalkRepository $talkRepos
/**
* @return Field[]
*/
private function prepareCfpStatsFields(TalkRepository $talkRepository, TalkToSpeakersRepository $talkToSpeakersRepository, Event $event, \DateTime $since = null): array
private function prepareCfpStatsFields(TalkRepository $talkRepository, TalkToSpeakersRepository $talkToSpeakersRepository, Event $event, ?\DateTime $since = null): array
{
$infos = [
'Nombre de talks' => $talkRepository->getNumberOfTalksByEvent($event, $since)['talks'],
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/TechLetter/Model/Sending.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getSendingDate(): ?\DateTime
return $this->sendingDate;
}

public function setSendingDate(\DateTime $sendingDate = null): self
public function setSendingDate(?\DateTime $sendingDate = null): self
{
$this->propertyChanged('sendingDate', $this->sendingDate, $sendingDate);
$this->sendingDate = $sendingDate;
Expand Down
Loading
Loading