]> BookStack Code Mirror - bookstack/commitdiff
Fixed entity excerpt function signature misalignment
authorDan Brown <redacted>
Sat, 6 Apr 2019 17:47:27 +0000 (18:47 +0100)
committerDan Brown <redacted>
Sat, 6 Apr 2019 17:47:27 +0000 (18:47 +0100)
app/Entities/Book.php
app/Entities/Bookshelf.php
app/Entities/Entity.php

index e722c4b107dc5dd3ea1262b7672e14bc7f9ef32e..77cacf632e03dad04c6b9dcec98843170e046224 100644 (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;
index d6a3cf0efec3cbd3f00da5b1b74b29a27b57960e..8f2cdf8ae135c677744d6ff8973d5eef9ce258df 100644 (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;
index d648f68e45869b1e8c514249a87c513ed88037e7..482d217662ae20b54f62578d88367b8daacb1098 100644 (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);
     }
 
     /**