mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 05:18:40 +00:00
Fix types
This commit is contained in:
parent
1100e7c532
commit
b9d2e9bb56
|
|
@ -361,8 +361,8 @@ class StringUtils
|
||||||
$size = mb_strlen($value);
|
$size = mb_strlen($value);
|
||||||
$countChars = self::mb_count_chars($value);
|
$countChars = self::mb_count_chars($value);
|
||||||
|
|
||||||
for ($i = 0; $i < $countChars; $i++) {
|
foreach ($countChars as $v) {
|
||||||
$p = $value[$i] / $size;
|
$p = $v / $size;
|
||||||
$entroy -= $p * log($p) / log(2);
|
$entroy -= $p * log($p) / log(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -374,11 +374,11 @@ class StringUtils
|
||||||
*
|
*
|
||||||
* @param string $input String to count chars.
|
* @param string $input String to count chars.
|
||||||
*
|
*
|
||||||
* @return int
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function mb_count_chars(string $input) : int
|
public static function mb_count_chars(string $input) : array
|
||||||
{
|
{
|
||||||
$l = mb_strlen($input, 'UTF-8');
|
$l = mb_strlen($input, 'UTF-8');
|
||||||
$unique = [];
|
$unique = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user