chore: fix phpstan errors

This commit is contained in:
Björn Fromme committed 2026-04-16 16:27:35 +02:00
1 parent 4e925171b3
commit 0fcecc9c58
109 files changed
+510 -429

No files matched your search

@@ -12,6 +12,7 @@ namespace App\BusProNet\Model;
*/
class AgeConstraintResult
{
/** @param array<string, mixed> $metadata */
public function __construct(
public readonly string $type,
public readonly ?int $ageFrom = null,
+2 -1
View File
@@ -12,6 +12,7 @@ namespace App\BusProNet\Model;
*/
class BaseData
{
/** @param array<array-key, mixed> $items */
public function __construct(private readonly array $items)
{
}
@@ -19,7 +20,7 @@ class BaseData
/**
* Retrieves all items in the base data collection.
*
* @return array The complete items array
* @return array<array-key, mixed> The complete items array
*/
public function getItems(): array
{
+1 -1
View File
@@ -220,7 +220,7 @@ class Booking
public function getInsuranceForParticipant(int $participantIndex): ?Insurance
{
foreach ($this->insurances as $insurance) {
if (in_array($participantIndex, $insurance->mapping ?? [], true)) {
if (in_array($participantIndex, $insurance->mapping, true)) {
return $insurance;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ class CrmSelectionGroup
* Maps BusPro IDs of CRM selection groups representing
* included services.
*
* @var array<string, string>
* @var array<int, string>
*/
public static array $includedServicesMapping = [
7 => 'Skipass',
-115
View File
@@ -1,115 +0,0 @@
<?php
declare(strict_types=1);
namespace App\BusProNet\Model;
/**
* Represents error codes and messages for the BusProNet API.
*
* This class provides a static mapping of error codes to their corresponding
* German error messages for consistent error handling across the application.
* Error codes range from 100-999 and cover various API scenarios.
*/
class Error
{
/**
* @var array<int, string>
*/
private static array $errors = [
100 => 'Anfrageknoten fehlt',
101 => 'Satzknoten fehlt in Anfrageknoten',
102 => 'Ungültiger Satztyp [#1#]',
103 => 'User fehlt',
104 => 'User fehlerhaft',
105 => 'Key fehlt',
106 => 'Key fehlerhaft',
200 => 'Keine Einträge vorhanden',
201 => 'Keine Partner zur Auswahl gefunden',
202 => 'Keinen Partner mit der ID [#1#] gefunden',
203 => 'Ungültiger Termin',
300 => 'IDReise fehlt',
301 => 'Reise nicht gefunden',
302 => 'IDLeistung (Hin & Rück) fehlt',
303 => 'IDLeistung passt nicht zu IDReise',
304 => 'Es konnte nicht für alle Teilnehmer ein Sitzplatz ermittelt werden',
305 => 'Anzahl Personen fehlt',
306 => 'Leistungen mit ID #1# nicht gefunden',
307 => 'Leistungen mit ID #1# passen nicht zur Reise mit ID #2#',
308 => 'Keine Zahlungsarten gefunden',
400 => 'IDPartner fehlt',
401 => 'Partner nicht gefunden',
402 => 'Bis-Termin fehlt',
403 => 'Keine Unterbringungsleistungen gefunden',
500 => 'Art fehlt',
501 => 'Reise- und Buchungszeitraum fehlen',
502 => 'Keine Kunden gefunden',
600 => 'Keine Gutscheine gefunden',
601 => 'Gutschein-IDs fehlen',
602 => 'Gutscheine mit ID #1# nicht gefunden',
610 => 'Buchungsart fehlt',
611 => 'Buchungsart falsch',
612 => 'Gutscheinart fehlt',
613 => 'Gutscheinart falsch',
614 => 'Gutscheinstamm-ID fehlt',
615 => 'Gutschein (Stamm) mit ID #1# nicht gefunden',
616 => 'Kapazität beim Gutschein #1# nicht ausreichend',
617 => 'Rechnungsempfänger fehlt',
618 => 'Zahlungsart fehlt',
619 => 'Agentur-ID fehlt',
620 => 'Agentur mit ID #1# nicht gefunden',
650 => '#1#',
700 => 'Keine Agenturen gefunden',
701 => 'Agentur mit ID #1# nicht gefunden',
800 => 'Produkt-ID fehlt',
801 => 'Produkt mit ID #1# nicht gefunden',
805 => 'Es wurden keine Produkte gefunden',
810 => 'Stammdaten (#1#) nicht gefunden',
900 => 'Buchungsart fehlt',
901 => 'Buchungsart falsch',
902 => 'Status fehlt',
903 => 'Status falsch',
904 => 'Agentur-ID fehlt',
905 => 'Agentur mit ID #1# nicht gefunden',
906 => 'Reise-ID fehlt',
907 => 'Reise mit ID #1# nicht gefunden',
908 => 'Reise mit ID #1# ist storniert',
909 => 'Beförderungen fehlen',
910 => 'Leistung mit ID #1# gehört nicht zur Reise',
911 => 'Leistung mit ID #1# gehört nicht zum Produkt',
912 => 'Beförderungsleistung für die #1# fehlt',
913 => 'Unterbringungen fehlen',
914 => 'Partner-ID fehlt',
915 => 'Partner mit ID #1# nicht gefunden',
916 => 'Ferienziel-Unterbringungen fehlen',
917 => 'Ferienziel: Zimmer-IDZ fehlt',
918 => 'Ferienziel: Kategorie fehlt',
919 => 'Ferienziel: Verpflegungs-ID fehlt',
920 => 'Ferienziel: Anreise fehlt',
921 => 'Ferienziel: Anreise passt nicht zur Beförderungsleistung (Hinfahrt)',
922 => 'Ferienziel: Abreise fehlt',
923 => 'Ferienziel: Abreise passt nicht zur Beförderungsleistung (Rückfahrt)',
924 => 'Ferienziel: Keine Preise zu den Daten gefunden',
925 => 'Ferienziel: Preis zu den Daten nicht gefunden',
930 => 'Zustiege fehlen',
931 => 'Zustieg mit ID #1# nicht gefunden',
932 => 'Zustieg mit ID #1# bei Leistung #2# nicht freigegeben',
933 => 'Sitzplan mit ID #1# bei Leistung #2# nicht freigegeben',
935 => 'Versicherung mit ID #1# nicht gefunden',
940 => 'Zahlungsart fehlt',
941 => 'Zahlungsart-ID fehlt',
942 => 'Zahlungsart mit ID #1# nicht gültig',
950 => 'Anmelder fehlt',
951 => 'Teilnehmerliste fehlt',
952 => 'Teilnehmer-ID fehlt',
960 => 'Preisfehler: Struct #1# / Obj #2#',
961 => 'Buchung konnte nicht gespeichert werden',
980 => 'Reise ist fürs Internet gesperrt',
981 => 'Reise ist nicht mehr buchbar (#1#)',
982 => 'Optionsbuchungen nicht zugelassen',
983 => 'Anfragebuchung nicht zugelassen',
984 => 'Leistung mit ID #1# nicht fürs Internet buchbar',
985 => 'Zustieg mit ID #1# nicht fürs Internet buchbar',
999 => 'Systemfehler: #1#',
];
}
+2
View File
@@ -56,7 +56,9 @@ class PersonalData
#[Assert\Valid(groups: ['personal_data'])]
public Communication $communication;
/** @var list<string> */
public array $roles = [];
/** @var list<string> */
public array $hotelCodes = [];
public function __construct()
+1
View File
@@ -45,6 +45,7 @@ class Pickup
#[Groups(['api:single', 'snapshot'])]
public ?float $priceInbound = null;
/** @var list<int> */
#[Groups(['api:booking'])]
public array $mapping = [];
+2
View File
@@ -64,6 +64,7 @@ class Room
#[Groups(['booking'])]
public ?string $board = null;
/** @var list<int> */
#[Groups(['booking'])]
public array $mapping = [];
@@ -73,6 +74,7 @@ class Room
#[Groups(['booking'])]
public ?float $totalPrice = null;
/** @var array<int, float|null> */
#[Groups(['booking'])]
public array $individualPrice = [];
+3
View File
@@ -55,6 +55,7 @@ class Service
#[Groups(['booking'])]
public ?int $totalCount = null;
/** @var list<int> */
#[Groups(['api:single', 'snapshot'])]
public array $mapping = [];
@@ -64,6 +65,7 @@ class Service
#[Groups(['api:single', 'snapshot'])]
public ?float $totalPrice = null;
/** @var array<int, float|null> */
#[Groups(['api:single', 'snapshot'])]
public array $individualPrice = [];
@@ -91,6 +93,7 @@ class Service
#[Groups(['api:single', 'api:list', 'snapshot'])]
public ?string $ageConstraintType = null;
/** @var array<string, mixed>|null */
#[Groups(['api:single'])]
public ?array $ageConstraintMetadata = null;
+2
View File
@@ -13,7 +13,9 @@ namespace App\BusProNet\Model;
class Surcharge
{
public ?string $label = null;
/** @var list<int> */
public array $mapping = [];
public ?float $totalPrice = null;
/** @var array<int, float|null> */
public array $individualPrice = [];
}
+1 -1
View File
@@ -203,7 +203,7 @@ class Travel
* Maps selection group IDs to their corresponding services based on
* the predefined included services mapping.
*
* @return array<int, Service> The included services from selection groups
* @return array<int, CrmSelectionGroup> The included services from selection groups
*/
public function getIncludedServices(): array
{