mirror of
https://github.com/standardebooks/web.git
synced 2025-07-19 04:44:48 -04:00
Bump PHPStan check level to max and add final round of type hints
This commit is contained in:
parent
110c091a7b
commit
70ae877dd8
15 changed files with 86 additions and 52 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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 you’d 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue