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

@@ -39,6 +39,7 @@ abstract class AbstractParser
return 0 < $node->count() && $this->stringToBool($node->text());
}
/** @return list<string> */
protected function getArrayValue(Crawler $node, string $separator = ','): array
{
if (0 === $node->count()) {
@@ -53,6 +53,7 @@ class AgeConstraintParserRegistry
return $this->mergeConstraintResults($results, $constraintData);
}
/** @param list<AgeConstraintResult> $results */
private function mergeConstraintResults(array $results, string $rawData): AgeConstraintResult
{
if (empty($results)) {
@@ -11,6 +11,7 @@ class ApiResponseParser extends AbstractParser
/**
* @throws ResponseParserException
*/
/** @param array<string, mixed> $additionalArgs */
public function parseXmlString(string $type, string $xml, array $additionalArgs = []): mixed
{
$crawler = new Crawler($xml);
@@ -15,6 +15,7 @@ use Symfony\Component\DomCrawler\Crawler;
*/
class BookingInsurancesParser extends AbstractParser
{
/** @return array<string, Insurance> */
public function parse(Crawler $result): array
{
$insurances = [];
@@ -112,6 +112,7 @@ class BookingParser extends AbstractParser
return $booking;
}
/** @return array<int, PersonalData> */
private function parseParticipants(Crawler $node): array
{
$participants = [];
@@ -27,7 +27,7 @@ class CrmAttributesResponseParser
$result
->filterXPath('//selektionsmerkmale/selektionsgruppe')
->each(function (Crawler $node) use (&$groups, &$roles, &$hotelCode) {
->each(function (Crawler $node) use (&$groups, &$roles) {
$group = new CrmSelectionGroup();
$group->id = (int) $node->attr('id');
$group->label = $node->attr('bezeichnung');
@@ -47,14 +47,14 @@ class CrmAttributesResponseParser
$roles[] = 'ROLE_HOUSE_MANAGER';
$hotelCodes[] = $matches[1];
}
if (static::BPN_CRM_ID_ADMIN === $attribute->id && true === $attribute->selected) {
if (self::BPN_CRM_ID_ADMIN === $attribute->id && true === $attribute->selected) {
$roles[] = 'ROLE_ADMIN';
$roles[] = 'ROLE_HOUSE_MANAGER';
}
if (static::BPN_CRM_ID_MANAGER === $attribute->id && true === $attribute->selected) {
if (self::BPN_CRM_ID_MANAGER === $attribute->id && true === $attribute->selected) {
$roles[] = 'ROLE_MANAGER';
}
if (static::BPN_CRM_ID_TEAMER === $attribute->id && true === $attribute->selected) {
if (self::BPN_CRM_ID_TEAMER === $attribute->id && true === $attribute->selected) {
$roles[] = 'ROLE_TEAMER';
}
@@ -90,7 +90,7 @@ class CrmAttributesResponseParser
;
if (true === in_array('ROLE_ADMIN', $roles, true)) {
$hotelCodes[] = static::BPN_DEFAULT_HOTEL_CODE;
$hotelCodes[] = self::BPN_DEFAULT_HOTEL_CODE;
}
$response = new CrmAttributes();
@@ -58,6 +58,7 @@ class DocumentsParser
return base64_decode($pdfData);
}
/** @return array{string, string} */
private function getFileInfo(Crawler $node): array
{
$pdfData = $this->decode($node->filterXPath('.//pdf'));
+11 -11
View File
@@ -37,7 +37,7 @@ class InsuranceParser extends AbstractParser
// Parse all individual insurances for reference lookup
$insurance = $this->parseInsuranceNode($node, false);
if (null !== $insurance && null !== $insurance->id) {
if (null !== $insurance->id) {
// Set complementary flag from XML attribute
$insurance->complementary = $isComplementary;
@@ -53,7 +53,7 @@ class InsuranceParser extends AbstractParser
$xmlContent->filterXPath('//versicherungspakete/versicherungspaket')
->each(function (Crawler $node) use (&$insurances, $individualInsurances) {
$insurance = $this->parseInsuranceNode($node, true, $individualInsurances);
if (null !== $insurance && null !== $insurance->id) {
if (null !== $insurance->id) {
// Parse contained insurance IDs
$insurance->containedInsuranceIds = $this->parseContainedInsuranceIds($node);
@@ -75,8 +75,8 @@ class InsuranceParser extends AbstractParser
/**
* Determines if a package contains any family insurances.
*
* @param Crawler $packageNode The package XML node
* @param array<int, Insurance> $individualInsurances Parsed individual insurances for reference
* @param Crawler $packageNode The package XML node
* @param array<string, Insurance> $individualInsurances Parsed individual insurances for reference
*
* @return bool True if any contained insurance is a family insurance
*/
@@ -96,13 +96,13 @@ class InsuranceParser extends AbstractParser
/**
* Parses a single insurance or package node.
*
* @param Crawler $node The XML node to parse
* @param bool $isPackage Whether this is a package node
* @param array<int, Insurance> $individualInsurances Individual insurances for package family detection
* @param Crawler $node The XML node to parse
* @param bool $isPackage Whether this is a package node
* @param array<string, Insurance> $individualInsurances Individual insurances for package family detection
*
* @return Insurance|null The parsed insurance object
* @return Insurance The parsed insurance object
*/
private function parseInsuranceNode(Crawler $node, bool $isPackage, array $individualInsurances = []): ?Insurance
private function parseInsuranceNode(Crawler $node, bool $isPackage, array $individualInsurances = []): Insurance
{
$insurance = new Insurance();
$insurance->package = $isPackage;
@@ -159,7 +159,7 @@ class InsuranceParser extends AbstractParser
*
* @param Crawler $xmlContent The XML content to scan
*
* @return array<int> Array of referenced insurance IDs
* @return list<string> Array of referenced insurance IDs
*/
private function collectReferencedInsuranceIds(Crawler $xmlContent): array
{
@@ -180,7 +180,7 @@ class InsuranceParser extends AbstractParser
*
* @param Crawler $node The package XML node
*
* @return array<int> Array of contained insurance IDs (always int, as they reference individual insurances)
* @return list<string> Array of contained insurance IDs
*/
private function parseContainedInsuranceIds(Crawler $node): array
{
@@ -7,6 +7,7 @@ use Symfony\Component\DomCrawler\Crawler;
class PickupsParser extends AbstractParser
{
/** @return array<int, Pickup> */
public function parse(Crawler $result): array
{
$pickups = [];
+1
View File
@@ -7,6 +7,7 @@ use Symfony\Component\DomCrawler\Crawler;
class RoomsParser extends AbstractParser
{
/** @return array<int, Room> */
public function parse(Crawler $result): array
{
$rooms = [];
@@ -8,6 +8,7 @@ use Symfony\Component\DomCrawler\Crawler;
class ServicesParser extends AbstractParser
{
/** @return array<int, Service> */
public function parse(Crawler $result, string $category, string $source): array
{
$services = [];
@@ -7,6 +7,7 @@ use Symfony\Component\DomCrawler\Crawler;
class SurchargesParser extends AbstractParser
{
/** @return list<Surcharge> */
public function parse(Crawler $result): array
{
$surcharges = [];