@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\helper; |
23 | 23 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $buff = ""; |
65 | 65 | foreach ($data as $k => $v) { |
66 | 66 | if ($k !== "sign" && $v !== "" && !is_array($v)) { |
67 | - $buff .= $k . "=" . $v . "&"; |
|
67 | + $buff .= $k."=".$v."&"; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | $buff = trim($buff, "&"); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\helper; |
23 | 23 | |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | $dh = opendir($name); |
68 | 68 | while ($file = readdir($dh)) { |
69 | 69 | if ($file !== "." && $file !== "..") { |
70 | - $fullpath = $name . "/" . $file; |
|
70 | + $fullpath = $name."/".$file; |
|
71 | 71 | if (!is_dir($fullpath)) { |
72 | 72 | unlink($fullpath); |
73 | - } else { |
|
73 | + }else { |
|
74 | 74 | $this->deletes($fullpath); |
75 | 75 | } |
76 | 76 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (empty($name)) { |
98 | 98 | throw new DtaException('请检查需要打包的路径名称'); |
99 | 99 | } |
100 | - $list = glob($name . "{$file_name}.{$suffix_name}"); |
|
100 | + $list = glob($name."{$file_name}.{$suffix_name}"); |
|
101 | 101 | $fileList = $list; |
102 | 102 | $zip = new ZipArchive(); |
103 | 103 | // 打开压缩包 |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | { |
121 | 121 | $files = []; |
122 | 122 | if (is_dir($path)) { |
123 | - $path = dirname($path) . '/' . basename($path) . '/'; |
|
123 | + $path = dirname($path).'/'.basename($path).'/'; |
|
124 | 124 | $file = dir($path); |
125 | 125 | while (false !== ($entry = $file->read())) { |
126 | 126 | if ($entry !== '.' && $entry !== '..') { |
127 | - $cur = $path . $entry; |
|
127 | + $cur = $path.$entry; |
|
128 | 128 | if (is_dir($cur)) { |
129 | - $subPath = $cur . '/'; |
|
129 | + $subPath = $cur.'/'; |
|
130 | 130 | $this->getFiles($subPath); |
131 | 131 | } |
132 | 132 | $files[] = $cur; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library |
18 | 18 | // +---------------------------------------------------------------------- |
19 | 19 | |
20 | -declare (strict_types=1); |
|
20 | +declare(strict_types=1); |
|
21 | 21 | |
22 | 22 | namespace DtApp\ThinkLibrary\helper; |
23 | 23 | |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | $charset = array_merge($lowerLetter, $upperLetter); |
59 | 59 | } elseif ($type === 7) { |
60 | 60 | $charset = array_merge($number, $lowerLetter, $upperLetter); |
61 | - } else { |
|
61 | + }else { |
|
62 | 62 | $charset = $number; |
63 | 63 | } |
64 | 64 | $str = ''; |
65 | 65 | // 生成字符串 |
66 | 66 | for ($i = 0; $i < $length; $i++) { |
67 | - $str .= $charset[random_int(0, count($charset) - 1)]; |
|
67 | + $str .= $charset[random_int(0, count($charset)-1)]; |
|
68 | 68 | // 验证规则 |
69 | 69 | if ($type === 4 && strlen($str) >= 2) { |
70 | 70 | if (!preg_match('/\d+/', $str) || !preg_match('/[a-z]+/', $str)) { |