original_string: public static function truncate($text, $length = 100)
      {
          return (self::length($text) > $length)
              ? rtrim(self::substr($text, 0, $length - 3)) . '...'
              : $text;
      }
code: public static function truncate($text, $length = 100)
      {
          return (self::length($text) > $length)
              ? rtrim(self::substr($text, 0, $length - 3)) . '...'
              : $text;
      }
code_tokens: public static function truncate ( $ text , $ length = 100 ) { return ( self :: length ( $ text ) > $ length ) ? rtrim ( self :: substr ( $ text , 0 , $ length - 3 ) ) . '...' : $ text ; }
docstring: Return a truncated string, suitable for notifications.
  
  @param string $text     The original string.
  @param integer $length  The maximum length.
  
  @return string  The truncated string, if longer than $length.
docstring_tokens: Return a truncated string suitable for notifications .