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
218 changes: 1 addition & 217 deletions phpstan-baseline.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sources/Afup/Utils/PDF_AG.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PDF_AG extends PDF
{
public const int CELL_HEIGHT = 7;
private $footerTitle = '';
private string $footerTitle = '';

/**
* @param Attendee[] $attendees
Expand Down Expand Up @@ -85,12 +85,12 @@ public function Footer(): void
$this->Cell(0, 10, $this->getFooterTitle() . ' - Page ' . $this->PageNo(), 0, 0, 'C');
}

public function getFooterTitle()
public function getFooterTitle(): string
{
return $this->footerTitle;
}

public function setFooterTitle($footerTitle): void
public function setFooterTitle(string $footerTitle): void
{
$this->footerTitle = $footerTitle;
}
Expand Down
4 changes: 2 additions & 2 deletions sources/AppBundle/Accounting/SearchResultProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public function __construct(
private readonly InvoiceRepository $invoiceRepository,
) {}


public function getResultsForQuery(string $query)
/** @return array<string, mixed> */
public function getResultsForQuery(string $query): array
{
if ($query === '') {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function __construct(
private readonly SubscriptionReminderLogRepository $subscriptionReminderLogRepository,
) {}

abstract protected function getText();
abstract protected function getSubject();
abstract protected function getKey();
abstract protected function getText(): string;
abstract protected function getSubject(): string;
abstract protected function getKey(): string;

public function sendReminder(NotifiableInterface $user): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

interface MembershipReminderInterface
{
public function sendReminder(NotifiableInterface $user);
public function sendReminder(NotifiableInterface $user): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function __construct(
private readonly SubscriptionReminderLogRepository $subscriptionReminderLogRepository,
) {}

abstract protected function getText();
abstract protected function getSubject();
abstract protected function getKey();
abstract protected function getText(): string;
abstract protected function getSubject(): string;
abstract protected function getKey(): string;

public function sendReminder(NotifiableInterface $user): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ class SeniorityComputer
{
public function __construct(private readonly MembershipFeeRepository $membershipFeeRepository) {}

/** @return array{years: int, first_year: int|null} */
public function computeCompanyAndReturnInfos(CompanyMember $companyMember): array
{
$cotis = $this->membershipFeeRepository->getListByUserTypeAndId(MemberType::MemberCompany, $companyMember->getId());

return $this->computeFromCotisationsAndReturnInfos($cotis);
}

public function compute(User $user)
public function compute(User $user): int
{
$infos = $this->computeAndReturnInfos($user);

return $infos['years'];
}

/** @return array{years: int, first_year: int|null} */
public function computeAndReturnInfos(User $user): array
{
$cotis = $this->membershipFeeRepository->getListByUserTypeAndId(MemberType::MemberPhysical, $user->getId());
Expand All @@ -38,6 +40,7 @@ public function computeAndReturnInfos(User $user): array

/**
* @param Collection<MembershipFee> $cotisations
* @return array{years: int, first_year: int|null}
*/
private function computeFromCotisationsAndReturnInfos(Collection $cotisations): array
{
Expand All @@ -64,7 +67,7 @@ private function computeFromCotisationsAndReturnInfos(Collection $cotisations):
$firstYear = null;

if ($years !== []) {
$firstYear = min($years);
$firstYear = (int) min($years);
}

return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use AppBundle\Event\Model\Repository\TicketTypeRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class PricesEditAction extends AbstractController
{
Expand All @@ -21,7 +22,7 @@ public function __construct(
private readonly EventSelectFactory $eventSelectFactory,
) {}

public function __invoke(Request $request, int $event, int $id)
public function __invoke(Request $request, int $event, int $id): Response
{
$event = $this->eventActionHelper->getEventById($event);
$ticketType = $this->ticketTypeRepository->get($id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
use AppBundle\Controller\Event\EventActionHelper;
use AppBundle\Event\Model\Repository\SpeakerRepository;
use AppBundle\Event\Speaker\SpeakerPage;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class SpeakerInfosAction
{
Expand All @@ -17,7 +19,7 @@ public function __construct(
private readonly SpeakerPage $speakerPage,
) {}

public function __invoke(Request $request)
public function __invoke(Request $request): RedirectResponse|Response
{
$event = $this->eventActionHelper->getFromRequest('id', false)->event;
$speaker = $this->speakerRepository->get($request->get('speaker_id'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function subscribeForm(): Response
]);
}

public function subscribe(Request $request)
public function subscribe(Request $request): Response
{
$subscribeForm = $this->getSubscriberType();
$subscribeForm->handleRequest($request);
Expand Down
3 changes: 2 additions & 1 deletion sources/AppBundle/Event/Speaker/SpeakerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class SpeakerPage extends AbstractController
{
Expand All @@ -32,7 +33,7 @@ public function __construct(
private readonly SpeakersExpensesStorage $speakersExpensesStorage,
) {}

public function handleRequest(Request $request, Event $event, Speaker $speaker)
public function handleRequest(Request $request, Event $event, Speaker $speaker): Response
{
$talks = array_filter(
iterator_to_array($this->talkRepository->getTalksBySpeaker($event, $speaker)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TicketTypeAvailability

public function __construct(private readonly TicketRepository $ticketRepository) {}

public function getStock(TicketEventType $ticketEventType, Event $event)
public function getStock(TicketEventType $ticketEventType, Event $event): int
{
// Les tickets depuis les tokens doivent fonctionner même après le sold out
if ($ticketEventType->getTicketType()->getTechnicalName() == TicketType::SPECIAL_PRICE_TECHNICAL_NAME) {
Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/Payment/PayboxBilling.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getCountryCode()
return $this->countryCode;
}

public function getCountryCodeIso3166Numeric()
public function getCountryCodeIso3166Numeric(): ?string
{
$country = $this->getCountryCode();

Expand Down
2 changes: 1 addition & 1 deletion sources/AppBundle/TechLetter/HtmlParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function getMeta($name): ?string
return $value;
}

public function getTitle()
public function getTitle(): ?string
{
$item = $this->dom->getElementsByTagName('title')->item(0);
if ($item === null) {
Expand Down
Loading