php-reading-time
php-reading-time copied to clipboard
Problem with ReadingTime::minute method result
As title, it seems that ReadingTime::minute method result should be integer type.
......
public function minutes()
{
return str_word_count($this->content) / $this->wordsPerMinute;
}
......
The original result will return float type and it cannot be used directly after calculating reading time.
I think it should cast this result to be integer type.
@DivineOmega, what do you think about that?
@peter279k I think it makes sense that this returns a float. You may want to know if a piece of text will take one and half minutes to read, for example.
@DivineOmega, thanks for your reply.
I think we need to round the returned value because floating point will be unlimited value.