Update PHPStan and Safe PHP, and review codebase for further type correctness

This commit is contained in:
Alex Cabal 2025-02-25 22:09:35 -06:00
parent e2e14a3551
commit 9d1b66d19e
35 changed files with 301 additions and 169 deletions

View file

@ -2,7 +2,9 @@
use function Safe\preg_match;
$feedType = '';
preg_match('/^\/feeds\/(opds|rss|atom)/ius', $_SERVER['REQUEST_URI'], $matches);
/** @var string $requestUri */
$requestUri = $_SERVER['REQUEST_URI'] ?? '';
preg_match('/^\/feeds\/(opds|rss|atom)/ius', $requestUri, $matches);
if(sizeof($matches) > 0){
$feedType = Enums\FeedType::tryFrom(strtolower($matches[1]));