Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/voku/helper/UTF8.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@
/**
* Get hexadecimal code point (U+xxxx) of a UTF-8 encoded character.
*
* INFO: opposite to UTF8::hex_to_chr()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the INFO: prefix is an established convention in this file for noting related functions, consider using the standard PHPDoc tag @see for cross-referencing. The @see tag is specifically designed for this purpose and is better recognized by PHPDoc parsing tools, which can improve the utility and maintainability of the documentation.

For example, this line could be:
@see UTF8::hex_to_chr() For the inverse operation.

This suggestion could be applied consistently to the other similar PHPDoc updates in this pull request for enhanced standardization.

     * @see UTF8::hex_to_chr() For the inverse operation.

*
* EXAMPLE: <code>UTF8::chr_to_hex('§'); // U+00a7</code>
*
* @param int|string $char <p>The input character</p>
Expand Down Expand Up @@ -1218,7 +1220,7 @@
/**
* Converts an int value into a UTF-8 character.
*
* INFO: opposite to UTF8::string()
* INFO: opposite to UTF8::chr_to_decimal()
*
* EXAMPLE: <code>UTF8::decimal_to_chr(931); // 'Σ'</code>
*
Expand Down Expand Up @@ -2872,7 +2874,7 @@
/**
* Converts a UTF-8 string to a series of HTML numbered entities.
*
* INFO: opposite to UTF8::html_decode()
* INFO: opposite to UTF8::html_entity_decode()
*
* EXAMPLE: <code>UTF8::html_encode('中文空白'); // '&#20013;&#25991;&#31354;&#30333;'</code>
*
Expand Down Expand Up @@ -6964,11 +6966,11 @@

$encoding = self::normalize_encoding($encoding, 'UTF-8');

if ((int) self::strlen_in_byte($str, $encoding) <= $length) {

Check failure on line 6969 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Static method voku\helper\UTF8::strlen_in_byte() invoked with 2 parameters, 1 required.
return $str;
}

return ((string) self::substr_in_byte($str, 0, $length - (int) self::strlen_in_byte($str_add_on), $encoding)) . $str_add_on;

Check failure on line 6973 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Static method voku\helper\UTF8::substr_in_byte() invoked with 4 parameters, 1-3 required.
}

/**
Expand Down Expand Up @@ -9031,6 +9033,8 @@
/**
* Get a binary representation of a specific string.
*
* INFO: opposite to UTF8::binary_to_str()
*
* EXAPLE: <code>UTF8::str_to_binary('😃'); // '11110000100111111001100010000011'</code>
*
* @param string $str <p>The input string.</p>
Expand Down Expand Up @@ -9494,7 +9498,7 @@
\Normalizer::normalize($str2, \Normalizer::NFD)
);

if (!is_int($cmp)) {

Check failure on line 9501 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Call to function is_int() with int<-1, 1> will always evaluate to true.
return $cmp < 0 ? -1 : ($cmp > 0 ? 1 : 0);
}

Expand Down Expand Up @@ -10272,7 +10276,7 @@
$needle = (string) $needle;

if ($haystack === '') {
if (\PHP_VERSION_ID >= 80000 && $needle === '') {

Check failure on line 10279 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Comparison operation ">=" between int<80000, max> and 80000 is always true.
return 0;
}

Expand Down Expand Up @@ -10782,7 +10786,7 @@
$needle = (string) $needle;

if ($haystack === '') {
if (\PHP_VERSION_ID >= 80000 && $needle === '') {

Check failure on line 10789 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Comparison operation ">=" between int<80000, max> and 80000 is always true.
return 0;
}

Expand Down Expand Up @@ -10954,7 +10958,7 @@
$needle = (string) $needle;

if ($haystack === '') {
if (\PHP_VERSION_ID >= 80000 && $needle === '') {

Check failure on line 10961 in src/voku/helper/UTF8.php

View workflow job for this annotation

GitHub Actions / tests (8, basic)

Comparison operation ">=" between int<80000, max> and 80000 is always true.
return 0;
}

Expand Down
Loading