提交的内容
This commit is contained in:
4
vendor/topthink/think-helper/src/helper/Str.php
vendored
Executable file → Normal file
4
vendor/topthink/think-helper/src/helper/Str.php
vendored
Executable file → Normal file
@ -80,7 +80,7 @@ class Str
|
||||
* @param string $addChars
|
||||
* @return string
|
||||
*/
|
||||
public static function random(int $length = 6, int $type = null, string $addChars = ''): string
|
||||
public static function random(int $length = 6, ?int $type = null, string $addChars = ''): string
|
||||
{
|
||||
$str = '';
|
||||
switch ($type) {
|
||||
@ -158,7 +158,7 @@ class Str
|
||||
* @param int|null $length
|
||||
* @return string
|
||||
*/
|
||||
public static function substr(string $string, int $start, int $length = null): string
|
||||
public static function substr(string $string, int $start, ?int $length = null): string
|
||||
{
|
||||
return mb_substr($string, $start, $length, 'UTF-8');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user