改名
This commit is contained in:
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Snowflake\Core;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
|
||||
/**
|
||||
* Class DateFormat
|
||||
@@ -96,7 +96,7 @@ class DateFormat
|
||||
* @param null $endTime
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public static function mtime($startTime, $endTime = null)
|
||||
public static function mtime($startTime, $endTime = null)
|
||||
{
|
||||
if ($endTime === null) {
|
||||
$endTime = microtime(true);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Snowflake\Core;
|
||||
|
||||
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
|
||||
/**
|
||||
* Class Help
|
||||
@@ -19,7 +19,7 @@ class Help
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public static function toXml(array $data)
|
||||
public static function toXml(array $data)
|
||||
{
|
||||
$xml = "<xml>";
|
||||
foreach ($data as $key => $val) {
|
||||
|
||||
+6
-6
@@ -5,7 +5,7 @@ namespace Snowflake\Core;
|
||||
|
||||
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
|
||||
/**
|
||||
* Class Str
|
||||
@@ -24,7 +24,7 @@ class Str
|
||||
* @return string
|
||||
* 获取随机字符串
|
||||
*/
|
||||
#[Pure] public static function rand(int $length = 20): string
|
||||
public static function rand(int $length = 20): string
|
||||
{
|
||||
$string = '';
|
||||
if ($length < 1) $length = 20;
|
||||
@@ -42,7 +42,7 @@ class Str
|
||||
* @return int|string 获取随机数字
|
||||
* 获取随机数字
|
||||
*/
|
||||
#[Pure] public static function random(int $length = 20): int|string
|
||||
public static function random(int $length = 20): int|string
|
||||
{
|
||||
$number = '';
|
||||
$default = str_split(self::NUMBER);
|
||||
@@ -119,7 +119,7 @@ class Str
|
||||
* @param string $append
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public static function cut($string, int $length = 20, $append = '...'): string
|
||||
public static function cut($string, int $length = 20, $append = '...'): string
|
||||
{
|
||||
if (empty($string)) {
|
||||
return '';
|
||||
@@ -167,7 +167,7 @@ class Str
|
||||
* @param $type
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public static function filename($file, $type): string
|
||||
public static function filename($file, $type): string
|
||||
{
|
||||
switch ($type) {
|
||||
case 'image/png':
|
||||
@@ -218,7 +218,7 @@ class Str
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
#[Pure] public static function encode(string $string): string
|
||||
public static function encode(string $string): string
|
||||
{
|
||||
return addslashes($string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user