* @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;
* @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;
if (mb_strlen($text) > $length) {
$text = mb_substr($text, 0, $length-3) . '...';
}
- return trim($text);
+ return trim($text);
}
/**