Fixed entity excerpt function signature misalignment

This commit is contained in:
Dan Brown 2019-04-06 18:47:27 +01:00
parent 7cda9b026e
commit d9cde4123d
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class Book extends Entity
* @param int $length
* @return string
*/
public function getExcerpt($length = 100)
public function getExcerpt(int $length = 100)
{
$description = $this->description;
return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;

View File

@ -78,7 +78,7 @@ class Bookshelf extends Entity
* @param int $length
* @return string
*/
public function getExcerpt($length = 100)
public function getExcerpt(int $length = 100)
{
$description = $this->description;
return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;

View File

@ -234,7 +234,7 @@ class Entity extends Ownable
if (mb_strlen($text) > $length) {
$text = mb_substr($text, 0, $length-3) . '...';
}
return trim($text);
return trim($text);
}
/**