mirror of
https://github.com/standardebooks/web.git
synced 2025-07-16 03:16:36 -04:00
Some type check fixes
This commit is contained in:
parent
d4707eb595
commit
bd4b8d8944
6 changed files with 6 additions and 5 deletions
|
@ -6,6 +6,7 @@ use function Safe\json_encode;
|
|||
use function Safe\glob;
|
||||
use function Safe\preg_match;
|
||||
use function Safe\preg_replace;
|
||||
use function Safe\sprintf;
|
||||
use function Safe\substr;
|
||||
|
||||
class Ebook{
|
||||
|
@ -108,7 +109,7 @@ class Ebook{
|
|||
// emits a warning. So, just silence the warning.
|
||||
$bytes = @filesize($this->WwwFilesystemPath . '/text/single-page.xhtml');
|
||||
$sizes = 'BKMGTP';
|
||||
$factor = floor((strlen($bytes) - 1) / 3);
|
||||
$factor = intval(floor((strlen((string)$bytes) - 1) / 3));
|
||||
$this->TextSinglePageSizeNumber = sprintf('%.1f', $bytes / pow(1024, $factor));
|
||||
$this->TextSinglePageSizeUnit = $sizes[$factor] ?? '';
|
||||
$this->TextSinglePageUrl = $this->Url . '/text/single-page';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue