PHP 8.1 base version update

This commit is contained in:
Clemens Schwaighofer
2023-02-28 18:04:42 +09:00
parent 1d220f25eb
commit 0a80abe8a4
30 changed files with 528 additions and 480 deletions

View File

@@ -122,7 +122,7 @@ class GetTextReader
* @param bool $enable_cache Enable or disable caching
* of strings (default on)
*/
public function __construct($Reader, bool $enable_cache = true)
public function __construct(FileReader|bool $Reader, bool $enable_cache = true)
{
// If there isn't a StreamReader, turn on short circuit mode.
if ((!is_object($Reader) && !$Reader) || (is_object($Reader) && $Reader->error)) {

View File

@@ -46,7 +46,7 @@ class Encoding
* @return void
* @deprecated Use \CoreLibs\Check\Encoding::setErrorChar();
*/
public static function setErrorChar($string): void
public static function setErrorChar(string|int|null $string): void
{
\CoreLibs\Check\Encoding::setErrorChar($string);
}
@@ -60,7 +60,7 @@ class Encoding
* @return string|int Set error character
* @deprecated Use \CoreLibs\Check\Encoding::getErrorChar();
*/
public static function getErrorChar(bool $return_substitute_func = false)
public static function getErrorChar(bool $return_substitute_func = false): string|int
{
return \CoreLibs\Check\Encoding::getErrorChar($return_substitute_func);
}
@@ -81,7 +81,7 @@ class Encoding
* @param string $string string to test
* @param string $from_encoding encoding of string to test
* @param string $to_encoding target encoding
* @return bool|array<string> false if no error or
* @return array<string>|false false if no error or
* array with failed characters
* @deprecated Use \CoreLibs\Check\Encoding::checkConvertEncoding();
*/
@@ -89,7 +89,7 @@ class Encoding
string $string,
string $from_encoding,
string $to_encoding
) {
): array|false {
return \CoreLibs\Check\Encoding::checkConvertEncoding($string, $from_encoding, $to_encoding);
}