This commit is contained in:
@@ -70,6 +70,33 @@ final class Nachrichtenvertrag
|
||||
self::pruefeZustand($daten['Zustand']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<int|array{Von_W: int, Bis_W: int}> $leistungswerte
|
||||
*/
|
||||
public static function enthaeltLeistungswert(array $leistungswerte, int $leistung): bool
|
||||
{
|
||||
foreach ($leistungswerte as $eintrag) {
|
||||
if (is_int($eintrag)) {
|
||||
if ($eintrag === $leistung) {
|
||||
return true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($eintrag)
|
||||
&& isset($eintrag['Von_W'], $eintrag['Bis_W'])
|
||||
&& is_int($eintrag['Von_W'])
|
||||
&& is_int($eintrag['Bis_W'])
|
||||
&& $leistung >= $eintrag['Von_W']
|
||||
&& $leistung <= $eintrag['Bis_W']
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $kopf
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user