0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-04 00:09:58 +00:00

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 * @param int $length
* @return string * @return string
*/ */
public function getExcerpt($length = 100) public function getExcerpt(int $length = 100)
{ {
$description = $this->description; $description = $this->description;
return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description; return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $description;

View file

@ -78,7 +78,7 @@ class Bookshelf extends Entity
* @param int $length * @param int $length
* @return string * @return string
*/ */
public function getExcerpt($length = 100) public function getExcerpt(int $length = 100)
{ {
$description = $this->description; $description = $this->description;
return strlen($description) > $length ? substr($description, 0, $length-3) . '...' : $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) { if (mb_strlen($text) > $length) {
$text = mb_substr($text, 0, $length-3) . '...'; $text = mb_substr($text, 0, $length-3) . '...';
} }
return trim($text); return trim($text);
} }
/** /**