Add CanEditEbooks benefit and clean up some PHPStan errors

This commit is contained in:
Alex Cabal 2024-12-14 11:50:16 -06:00
parent 23b5c8ef31
commit 1a742baa51
10 changed files with 75 additions and 14 deletions

View file

@ -444,7 +444,7 @@ class Ebook{
protected function GetReadingTime(): string{
if(!isset($this->_ReadingTime)){
$readingTime = ceil($this->WordCount / AVERAGE_READING_WORDS_PER_MINUTE);
$readingTime = ceil(($this->WordCount ?? 0) / AVERAGE_READING_WORDS_PER_MINUTE);
$this->_ReadingTime = (string)$readingTime;
if($readingTime < 60){