Add more type checking to satisfy PHPStan and update some PHPStan exceptions

This commit is contained in:
Alex Cabal 2020-06-26 12:52:44 -05:00
parent 43b9f1a6f5
commit 5b2557c858
3 changed files with 37 additions and 7 deletions

View file

@ -4,6 +4,7 @@ require_once('/standardebooks.org/web/lib/Core.php');
use function Safe\krsort;
use function Safe\getopt;
use function Safe\preg_replace;
use function Safe\sort;
$longopts = array("webroot:", "weburl:");
$options = getopt("", $longopts);
@ -51,8 +52,8 @@ $subjectsFeed->Save(WEB_ROOT . '/opds/subjects/index.xml');
// Now generate each individual subject feed
foreach($ebooksBySubject as $subject => $ebooks){
krsort($ebooks);
$subjectFeed = new OpdsAcquisitionFeed('/opds/subjects/' . Formatter::MakeUrlSafe($subject), $subject, '/opds/subjects', $ebooks);
$subjectFeed->Save(WEB_ROOT . '/opds/subjects/' . Formatter::MakeUrlSafe($subject) . '.xml');
$subjectFeed = new OpdsAcquisitionFeed('/opds/subjects/' . Formatter::MakeUrlSafe((string)$subject), (string)$subject, '/opds/subjects', $ebooks);
$subjectFeed->Save(WEB_ROOT . '/opds/subjects/' . Formatter::MakeUrlSafe((string)$subject) . '.xml');
}
// Create the 'all' feed