Bump PHPStan check level to max and add final round of type hints

This commit is contained in:
Alex Cabal 2024-05-13 10:48:05 -05:00
parent 110c091a7b
commit 70ae877dd8
15 changed files with 86 additions and 52 deletions

View file

@ -16,10 +16,12 @@ if($GLOBALS['User'] !== null && $GLOBALS['User']->Benefits->CanBulkDownload){
$collection = [];
try{
/** @var array<string, array<string, stdClass>> $collection */
$collection = apcu_fetch('bulk-downloads-' . $class);
}
catch(Safe\Exceptions\ApcuException){
$result = Library::RebuildBulkDownloadsCache();
/** @var array<string, array<string, stdClass>> $collection */
$collection = $result[$class];
}

View file

@ -17,10 +17,13 @@ try{
// Get all collections and then find the specific one we're looking for
try{
/** @var array<stdClass> $collections */
$collections = apcu_fetch('bulk-downloads-collections');
}
catch(Safe\Exceptions\ApcuException){
$result = Library::RebuildBulkDownloadsCache();
/** @var array<stdClass> $collections */
$collections = $result['collections'];
}
@ -41,10 +44,13 @@ try{
// Get all authors and then find the specific one we're looking for
try{
/** @var array<stdClass> $collections */
$collections = apcu_fetch('bulk-downloads-authors');
}
catch(Safe\Exceptions\ApcuException){
$result = Library::RebuildBulkDownloadsCache();
/** @var array<stdClass> $collections */
$collections = $result['authors'];
}
@ -70,7 +76,7 @@ catch(Exceptions\CollectionNotFoundException){
?><?= Template::Header(['title' => 'Download ', 'highlight' => '', 'description' => 'Download zip files containing all of the Standard Ebooks released in a given month.']) ?>
<main>
<section class="bulk-downloads">
<h1>Download the <?= $collection->Label ?> Collection</h1>
<h1>Download the <?= $collection?->Label ?> Collection</h1>
<? if($canDownload){ ?>
<p>Select the ebook format in which youd like to download this collection.</p>
<p>You can also read about <a href="/help/how-to-use-our-ebooks#which-file-to-download">which ebook format to download</a>.</p>