Returns length helper

@param string $data
@return string
175519
protected function length_helper($data){
	    if ( ($this->min || $this->max) && $this->length_helper ){
            $notice = [];
            $class_name = 'ok';
            if( $this->min ){
                $notice[] = sprintf($this->__('%s chars or more'), number_format($this->min));
                if( $this->min > mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }
            if( $this->max ){
                $notice[] = sprintf($this->__('%s chars or less'), number_format($this->max));
                if( $this->max < mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }

            return sprintf('<p class="char-counter %s"><i class="dashicons"></i> <strong>%s</strong><span> %s</span><small>%s</small></p>',
                $class_name, mb_strlen($data, 'utf-8'), $this->__('Letters'), implode(', ', $notice));
        }else{
            return '';
        }
    }
559638
public function parseContentLength($data)
    {
        $this->buffer .= $data;
        if (strlen($this->buffer) >= $this->contentLength) {
            $this->completed();
        }
    }
336493
public static function typeof($data) {
        if ($data instanceof \Closure) return "closure";

        $type = strtolower(gettype($data));
        if ($type === "double") return "float";
        return $type;
    }
113420
public function normaliseExtension($data) {
    if (is_object($data)) {
      if (isset($data->extension)) {
        $data->extension = (object) $data->extension;
      }
    }
    elseif (is_array($data)) {
      if (isset($data['extension'])) {
        $data['extension'] = (object) $data['extension'];
      }
    }

    return $data;
  }
1114525
public function writeData($data)
	{
		if (strlen($data) - 4 > $this->_limit) {
			$data = $this->_addContinue($data);
		}
		$this->_datasize += strlen($data);

		return $data;
	}
199777
private function readFieldLength(string &$buffer): int
    {
        $block  = unpack('C4', $buffer);

        $length = $block[1];
        $skip   = 1;

        if ($length & 0x80) {
            $fullBlock = unpack('N', $buffer);
            $length    = $fullBlock[1] & 0x7FFFFFFF;
            $skip      = 4;
        }

        $buffer = substr($buffer, $skip);

        return $length;
    }
989661
public function checkLength($value)
    {
        if (strlen($value) != 8) {
            $this->setCheck(false);
        } else {
            $this->setCheck(true);
        }

        return parent::checkLength($value);
    }
365823
protected function maxMultidimensionalArrayStringSize(array $data)
    {
        $lengths = [];
        for ($i =0; $i < count($data); $i++) {
            for ($j = 0; $j < count($data[$i]); $j++) {
                $temp_length = strlen($data[$i][$j]);
                if (!isset($lengths[$j])) {
                    $lengths[$j] = $temp_length;
                    continue;
                } elseif ($lengths[$j] < $temp_length) {
                    $lengths[$j] = $temp_length;
                    continue;
                }
            }
        }
        return $lengths;
    }
203173
private function limitLength($value)
    {
        if ($this->stringUtils->strlen($value) > \Dotdigitalgroup\Email\Helper\Data::DM_FIELD_LIMIT) {
            $value = mb_substr($value, 0, \Dotdigitalgroup\Email\Helper\Data::DM_FIELD_LIMIT);
        }

        return $value;
    }
1123992
public function getLength(): int
    {
        switch (\gettype($this->data)) {
            case 'array':
            case 'object':
                if (\is_array($this->data) || $this->data instanceof \Countable) {
                    return \count($this->data);
                }
                break;

            case 'string':
                return \strlen($this->data);
                break;
        }

        return -1;
    }
1191670
protected function getLengths(array $data)
    {
        for ($i = 0; $i < $this->columns; $i++) {
            $this->maxLength[$i] = 0;
            foreach ($this->headers as $field) {
                $field = strip_tags($field);
                if (strlen($field) > $this->maxLength[$i]) {
                    $this->maxLength[$i] = strlen($field);
                }
            }
        }

        foreach ($data as $row) {
            $i = 0;
            foreach ($row as $field) {
                $field = strip_tags($field);
                if (strlen($field) > $this->maxLength[$i]) {
                    $this->maxLength[$i] = strlen($field);
                }
                $i++;
            }
        }
    }
28152
public function add(string $data): string
    {
        $n = $this->_blocksize - strlen($data) % $this->_blocksize;
        return $data . str_repeat(chr($n), $n);
    }
869985
public function get_content_length($content)
	{
		$content = $this->restore_square_brackets_in_smilies($content);

		$content_length = utf8_strlen($content);
		$last_smiley = false;
		$last_html_closing = 0;
		while (($last_html_opening = utf8_strpos($content, '<', $last_html_closing)) !== false)
		{
			$last_html_closing = utf8_strpos($content, '>', $last_html_opening);
			if (($smiley_code = utf8_substr($content, $last_html_opening + 6, ($last_html_closing - $last_html_opening - 9))) != '--')
			{
				if ($last_smiley == $smiley_code)
				{
					$content_length += utf8_strlen($smiley_code);
					$last_smiley = false;
				}
				else
				{
					$last_smiley = $smiley_code;
				}
			}
			$content_length -= ($last_html_closing - $last_html_opening) + 1;
		}
		return $content_length;
	}
1208670
private static function retrievePositiveInteger(string $data): string
    {
        while (0 === \mb_strpos($data, '00', 0, '8bit') && \mb_substr($data, 2, 2, '8bit') > '7f') {
            $data = \mb_substr($data, 2, null, '8bit');
        }

        return $data;
    }
954639
public function getShortMessage($message)
    {
        static $hasMbString;

        if (null === $hasMbString) {
            $hasMbString = function_exists('mb_strlen');
        }

        $maxLength = 45;

        if ($hasMbString) {
            if (mb_strlen($message, 'UTF-8') > $maxLength) {
                $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
            }
        } else {
            if (strlen($message) > $maxLength) {
                $message = substr($message, 0, $maxLength - 4) . ' ...';
            }
        }

        return $message;
    }
912706
public function format(&$data) {
		$data = $this->normalize($data);
		$data = $this->convertToString($data);

		return $data;
	}
185726
protected function dataLength($temp)
   {
      if(count($temp) == 0) return 0;
      
      $arKeys = array_keys($temp);
      sort($arKeys);
      $dataLength = $arKeys[count($arKeys)-1];
      return $dataLength+1;
   }