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:
parent
7cda9b026e
commit
d9cde4123d
3 changed files with 3 additions and 3 deletions
app/Entities
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue