diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 0a1e27671..77f64dc72 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -1489,42 +1489,18 @@ 'count' => 6, 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between mixed and \' \\- Page \' results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', -]; $ignoreErrors[] = [ 'message' => '#^Binary operation "\\." between non\\-falsy\\-string and mixed results in an error\\.$#', 'identifier' => 'binaryOp.invalid', 'count' => 7, 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\PDF_AG\\:\\:getFooterTitle\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\PDF_AG\\:\\:setFooterTitle\\(\\) has parameter \\$footerTitle with no type specified\\.$#', - 'identifier' => 'missingType.parameter', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Afup\\\\Site\\\\Utils\\\\PDF_AG\\:\\:writeRow\\(\\) has parameter \\$row with no value type specified in iterable type array\\.$#', 'identifier' => 'missingType.iterableValue', 'count' => 1, 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Property Afup\\\\Site\\\\Utils\\\\PDF_AG\\:\\:\\$footerTitle has no type specified\\.$#', - 'identifier' => 'missingType.property', - 'count' => 1, - 'path' => __DIR__ . '/sources/Afup/Utils/PDF_AG.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot access property \\$name on AppBundle\\\\Site\\\\Entity\\\\Country\\|null\\.$#', 'identifier' => 'property.nonObject', @@ -2083,12 +2059,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Accounting/Model/Repository/TransactionRepository.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Accounting\\\\SearchResultProvider\\:\\:getResultsForQuery\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Accounting/SearchResultProvider.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot cast mixed to int\\.$#', 'identifier' => 'cast.int', @@ -2101,24 +2071,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Accounting/TransactionModification.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\CompanyMembership\\\\AbstractCompanyReminder\\:\\:getKey\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\CompanyMembership\\\\AbstractCompanyReminder\\:\\:getSubject\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\CompanyMembership\\\\AbstractCompanyReminder\\:\\:getText\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$email of class AppBundle\\\\Email\\\\Mailer\\\\MailUser constructor expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -2131,30 +2083,12 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$reminderKey of method AppBundle\\\\Association\\\\Model\\\\SubscriptionReminderLog\\:\\:setReminderKey\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$subject of class AppBundle\\\\Email\\\\Mailer\\\\Message constructor expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$userId of method AppBundle\\\\Association\\\\Model\\\\SubscriptionReminderLog\\:\\:setUserId\\(\\) expects int, mixed given\\.$#', 'identifier' => 'argument.type', 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$content of method AppBundle\\\\Email\\\\Mailer\\\\Mailer\\:\\:sendTransactional\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Method AppBundle\\\\Association\\\\CompanyMembership\\\\CompanyReminderFactory\\:\\:getReminder\\(\\) has parameter \\$class with no type specified\\.$#', 'identifier' => 'missingType.parameter', @@ -2443,12 +2377,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/Form/UserType.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\MembershipReminderInterface\\:\\:sendReminder\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/MembershipReminderInterface.php', -]; $ignoreErrors[] = [ 'message' => '#^Method AppBundle\\\\Association\\\\Model\\\\CompanyMember\\:\\:getFormattedRelatedAfupOffices\\(\\) return type has no value type specified in iterable type array\\.$#', 'identifier' => 'missingType.iterableValue', @@ -3355,24 +3283,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/NotifiableInterface.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\AbstractUserReminder\\:\\:getKey\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\AbstractUserReminder\\:\\:getSubject\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\AbstractUserReminder\\:\\:getText\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$email of class AppBundle\\\\Email\\\\Mailer\\\\MailUser constructor expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -3385,48 +3295,18 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$reminderKey of method AppBundle\\\\Association\\\\Model\\\\SubscriptionReminderLog\\:\\:setReminderKey\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$subject of class AppBundle\\\\Email\\\\Mailer\\\\Message constructor expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$userId of method AppBundle\\\\Association\\\\Model\\\\SubscriptionReminderLog\\:\\:setUserId\\(\\) expects int, mixed given\\.$#', 'identifier' => 'argument.type', 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#2 \\$content of method AppBundle\\\\Email\\\\Mailer\\\\Mailer\\:\\:sendTransactional\\(\\) expects string, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php', -]; $ignoreErrors[] = [ 'message' => '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#', 'identifier' => 'foreach.nonIterable', 'count' => 4, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\+" between mixed and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 2, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between \'Membre depuis \' and mixed results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 2, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', -]; $ignoreErrors[] = [ 'message' => '#^Binary operation "\\." between \'Participation à l…\' and mixed results in an error\\.$#', 'identifier' => 'binaryOp.invalid', @@ -3469,12 +3349,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Binary operation "\\." between mixed and \'ans\' results in an error\\.$#', - 'identifier' => 'binaryOp.invalid', - 'count' => 2, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot access offset \'code\' on mixed\\.$#', 'identifier' => 'offsetAccess.nonOffsetAccessible', @@ -3553,12 +3427,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Cannot use \\-\\- on mixed\\.$#', - 'identifier' => 'postDec.type', - 'count' => 2, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php', -]; $ignoreErrors[] = [ 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\BadgesComputer\\:\\:filterExistingBadges\\(\\) has parameter \\$badgesInfos with no value type specified in iterable type array\\.$#', 'identifier' => 'missingType.iterableValue', @@ -3619,30 +3487,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/SeniorityComputer.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\SeniorityComputer\\:\\:compute\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/SeniorityComputer.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\SeniorityComputer\\:\\:computeAndReturnInfos\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/SeniorityComputer.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\SeniorityComputer\\:\\:computeCompanyAndReturnInfos\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/SeniorityComputer.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\SeniorityComputer\\:\\:computeFromCotisationsAndReturnInfos\\(\\) return type has no value type specified in iterable type array\\.$#', - 'identifier' => 'missingType.iterableValue', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/SeniorityComputer.php', -]; $ignoreErrors[] = [ 'message' => '#^Method AppBundle\\\\Association\\\\UserMembership\\\\UserReminderFactory\\:\\:getReminder\\(\\) has parameter \\$class with no type specified\\.$#', 'identifier' => 'missingType.parameter', @@ -4777,12 +4621,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Event\\\\PricesEditAction\\:\\:__invoke\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$ticketEventType of method AppBundle\\\\Event\\\\Model\\\\Repository\\\\TicketEventTypeRepository\\:\\:update\\(\\) expects AppBundle\\\\Event\\\\Model\\\\TicketEventType, AppBundle\\\\Event\\\\Model\\\\TicketEventType\\|null given\\.$#', 'identifier' => 'argument.type', @@ -4999,12 +4837,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Event/Session/IndexAction.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Event\\\\SpeakerInfosAction\\:\\:__invoke\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#3 \\$speaker of method AppBundle\\\\Event\\\\Speaker\\\\SpeakerPage\\:\\:handleRequest\\(\\) expects AppBundle\\\\Event\\\\Model\\\\Speaker, AppBundle\\\\Event\\\\Model\\\\Speaker\\|null given\\.$#', 'identifier' => 'argument.type', @@ -6439,12 +6271,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Controller/Event/Speaker/FilesAction.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Controller\\\\Event\\\\Speaker\\\\PageAction\\:\\:__invoke\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\Response but returns mixed\\.$#', - 'identifier' => 'return.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Controller/Event/Speaker/PageAction.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$eventSlug of method AppBundle\\\\Controller\\\\Event\\\\EventActionHelper\\:\\:getEvent\\(\\) expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -7327,12 +7153,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Controller/Website/NewsletterController.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Controller\\\\Website\\\\NewsletterController\\:\\:subscribe\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Controller/Website/NewsletterController.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#2 \\$email of method AppBundle\\\\Mailchimp\\\\Mailchimp\\:\\:subscribeAddress\\(\\) expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -9823,12 +9643,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Event/Speaker/SpeakerPage.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Event\\\\Speaker\\\\SpeakerPage\\:\\:handleRequest\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Event/Speaker/SpeakerPage.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$file of method AppBundle\\\\SpeakerInfos\\\\SpeakersExpensesStorage\\:\\:store\\(\\) expects Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\UploadedFile, mixed given\\.$#', 'identifier' => 'argument.type', @@ -10027,12 +9841,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/PurchaseTypeFactory.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Event\\\\Ticket\\\\RegistrationsExportGenerator\\:\\:computeSeniority\\(\\) should return int but returns mixed\\.$#', - 'identifier' => 'return.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/RegistrationsExportGenerator.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#', 'identifier' => 'argument.type', @@ -10081,12 +9889,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/TicketOffers.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#4 \\$availableTickets of class AppBundle\\\\Event\\\\Model\\\\TicketOffer constructor expects int, mixed given\\.$#', - 'identifier' => 'argument.type', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/TicketOffers.php', -]; $ignoreErrors[] = [ 'message' => '#^Binary operation "\\-" between int and mixed results in an error\\.$#', 'identifier' => 'binaryOp.invalid', @@ -10117,12 +9919,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Event\\\\Ticket\\\\TicketTypeAvailability\\:\\:getStock\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#', 'identifier' => 'argument.type', @@ -11335,12 +11131,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/Payment/PayboxBilling.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\Payment\\\\PayboxBilling\\:\\:getCountryCodeIso3166Numeric\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/Payment/PayboxBilling.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$alpha2 of method League\\\\ISO3166\\\\ISO3166\\:\\:alpha2\\(\\) expects string, mixed given\\.$#', 'identifier' => 'argument.type', @@ -12280,7 +12070,7 @@ $ignoreErrors[] = [ 'message' => '#^Cannot cast mixed to string\\.$#', 'identifier' => 'cast.string', - 'count' => 4, + 'count' => 2, 'path' => __DIR__ . '/sources/AppBundle/TechLetter/DataExtractor.php', ]; $ignoreErrors[] = [ @@ -12325,12 +12115,6 @@ 'count' => 1, 'path' => __DIR__ . '/sources/AppBundle/TechLetter/HtmlParser.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method AppBundle\\\\TechLetter\\\\HtmlParser\\:\\:getTitle\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/sources/AppBundle/TechLetter/HtmlParser.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#1 \\$meta of method AppBundle\\\\TechLetter\\\\HtmlParser\\:\\:getSocialMeta\\(\\) expects string, mixed given\\.$#', 'identifier' => 'argument.type', diff --git a/sources/Afup/Utils/PDF_AG.php b/sources/Afup/Utils/PDF_AG.php index da9d4c3db..47af2c938 100644 --- a/sources/Afup/Utils/PDF_AG.php +++ b/sources/Afup/Utils/PDF_AG.php @@ -10,7 +10,7 @@ class PDF_AG extends PDF { public const int CELL_HEIGHT = 7; - private $footerTitle = ''; + private string $footerTitle = ''; /** * @param Attendee[] $attendees @@ -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; } diff --git a/sources/AppBundle/Accounting/SearchResultProvider.php b/sources/AppBundle/Accounting/SearchResultProvider.php index 91900255a..02360f2f2 100644 --- a/sources/AppBundle/Accounting/SearchResultProvider.php +++ b/sources/AppBundle/Accounting/SearchResultProvider.php @@ -18,8 +18,8 @@ public function __construct( private readonly InvoiceRepository $invoiceRepository, ) {} - - public function getResultsForQuery(string $query) + /** @return array */ + public function getResultsForQuery(string $query): array { if ($query === '') { return []; diff --git a/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php b/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php index 1d9212c89..560343b97 100644 --- a/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php +++ b/sources/AppBundle/Association/CompanyMembership/AbstractCompanyReminder.php @@ -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 { diff --git a/sources/AppBundle/Association/MembershipReminderInterface.php b/sources/AppBundle/Association/MembershipReminderInterface.php index d2621eb79..023dfd39c 100644 --- a/sources/AppBundle/Association/MembershipReminderInterface.php +++ b/sources/AppBundle/Association/MembershipReminderInterface.php @@ -6,5 +6,5 @@ interface MembershipReminderInterface { - public function sendReminder(NotifiableInterface $user); + public function sendReminder(NotifiableInterface $user): void; } diff --git a/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php b/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php index 6b4ce94f8..1da3c9a0c 100644 --- a/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php +++ b/sources/AppBundle/Association/UserMembership/AbstractUserReminder.php @@ -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 { diff --git a/sources/AppBundle/Association/UserMembership/SeniorityComputer.php b/sources/AppBundle/Association/UserMembership/SeniorityComputer.php index 2d88e1c48..e9983c1a4 100644 --- a/sources/AppBundle/Association/UserMembership/SeniorityComputer.php +++ b/sources/AppBundle/Association/UserMembership/SeniorityComputer.php @@ -15,6 +15,7 @@ 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()); @@ -22,13 +23,14 @@ public function computeCompanyAndReturnInfos(CompanyMember $companyMember): arra 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()); @@ -38,6 +40,7 @@ public function computeAndReturnInfos(User $user): array /** * @param Collection $cotisations + * @return array{years: int, first_year: int|null} */ private function computeFromCotisationsAndReturnInfos(Collection $cotisations): array { @@ -64,7 +67,7 @@ private function computeFromCotisationsAndReturnInfos(Collection $cotisations): $firstYear = null; if ($years !== []) { - $firstYear = min($years); + $firstYear = (int) min($years); } return [ diff --git a/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php b/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php index 4ed28eae8..0374eb7fb 100644 --- a/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php +++ b/sources/AppBundle/Controller/Admin/Event/PricesEditAction.php @@ -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 { @@ -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); diff --git a/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php b/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php index b47cbf79c..080884067 100644 --- a/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php +++ b/sources/AppBundle/Controller/Admin/Event/SpeakerInfosAction.php @@ -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 { @@ -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')); diff --git a/sources/AppBundle/Controller/Website/NewsletterController.php b/sources/AppBundle/Controller/Website/NewsletterController.php index f5b974c99..dc7e48ce2 100644 --- a/sources/AppBundle/Controller/Website/NewsletterController.php +++ b/sources/AppBundle/Controller/Website/NewsletterController.php @@ -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); diff --git a/sources/AppBundle/Event/Speaker/SpeakerPage.php b/sources/AppBundle/Event/Speaker/SpeakerPage.php index 6793abeda..0e31aff1f 100644 --- a/sources/AppBundle/Event/Speaker/SpeakerPage.php +++ b/sources/AppBundle/Event/Speaker/SpeakerPage.php @@ -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 { @@ -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)), diff --git a/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php b/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php index 8b80b7469..ab487f498 100644 --- a/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php +++ b/sources/AppBundle/Event/Ticket/TicketTypeAvailability.php @@ -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) { diff --git a/sources/AppBundle/Payment/PayboxBilling.php b/sources/AppBundle/Payment/PayboxBilling.php index b5f14fe6c..daa0f2194 100644 --- a/sources/AppBundle/Payment/PayboxBilling.php +++ b/sources/AppBundle/Payment/PayboxBilling.php @@ -66,7 +66,7 @@ public function getCountryCode() return $this->countryCode; } - public function getCountryCodeIso3166Numeric() + public function getCountryCodeIso3166Numeric(): ?string { $country = $this->getCountryCode(); diff --git a/sources/AppBundle/TechLetter/HtmlParser.php b/sources/AppBundle/TechLetter/HtmlParser.php index 1f5eba929..6323aac9b 100644 --- a/sources/AppBundle/TechLetter/HtmlParser.php +++ b/sources/AppBundle/TechLetter/HtmlParser.php @@ -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) {