Skip to content

Commit 21f4c43

Browse files
committed
fix(ZMS): remove redundant null checks for Psalm
Drop dead null coalescing on query string and null comparison on client IP where both values are already non-nullable strings.
1 parent e22d3a5 commit 21f4c43

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

zmscitizenapi/src/Zmscitizenapi/Middleware/IpFilterMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
3131
try {
3232
$ip = ClientIpHelper::getClientIp();
3333
$uri = (string)$request->getUri();
34-
if ($ip === null || !filter_var($ip, FILTER_VALIDATE_IP)) {
34+
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
3535
$this->logger->logInfo('Invalid IP address detected', [
3636
'ip' => $ip,
3737
'uri' => $uri

zmsticketprinter/src/Zmsticketprinter/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private function getQueryStringWithLang()
112112
if (!strpos($queryString, 'lang=')) {
113113
$queryString .= '&lang=de';
114114
}
115-
return str_replace('/&', '', $queryString ?? '');
115+
return str_replace('/&', '', $queryString);
116116
}
117117

118118
private function getTranslations($languageConfig, $currentLang)

0 commit comments

Comments
 (0)