From 54260e607aec5be951a0a08d8d90d462e7fa76e6 Mon Sep 17 00:00:00 2001 From: Tinywan <756684177@qq.com> Date: Sat, 2 Apr 2022 21:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9php7.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- src/Adapter/AdapterAbstract.php | 13 +++++-------- src/Adapter/AdapterInterface.php | 1 - src/Adapter/CosAdapter.php | 3 --- src/Adapter/LocalAdapter.php | 3 --- src/Adapter/OssAdapter.php | 13 +++++-------- src/Adapter/QiniuAdapter.php | 8 ++++---- src/Storage.php | 3 +-- 8 files changed, 16 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index 62401d1..f6e5250 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "library", "license": "MIT", "require": { - "php": ">=7.4", + "php": ">=7.2", "workerman/webman-framework": "^1.2.1" }, "autoload": { diff --git a/src/Adapter/AdapterAbstract.php b/src/Adapter/AdapterAbstract.php index 015eddf..d2bd032 100644 --- a/src/Adapter/AdapterAbstract.php +++ b/src/Adapter/AdapterAbstract.php @@ -36,27 +36,27 @@ abstract class AdapterAbstract implements AdapterInterface /** * 被允许的文件类型列表. */ - protected array $includes; + protected $includes; /** * 不被允许的文件类型列表. */ - protected array $excludes; + protected $excludes; /** * 单个文件的最大字节数. */ - protected int $singleLimit; + protected $singleLimit; /** * 多个文件的最大数量. */ - protected int $totalLimit; + protected $totalLimit; /** * 文件上传的最大数量. */ - protected int $nums; + protected $nums; /** * AdapterAbstract constructor. @@ -127,8 +127,6 @@ protected function getSize(UploadFile $file): int * @desc: 允许上传文件 * * @author Tinywan(ShaoBo Wan) - * - * @throws UploadFileException */ protected function allowedFile(): bool { @@ -156,7 +154,6 @@ protected function allowedFile(): bool * * @author Tinywan(ShaoBo Wan) * - * @throws UploadFileException */ protected function allowedFileSize() { diff --git a/src/Adapter/AdapterInterface.php b/src/Adapter/AdapterInterface.php index e074cc5..6e4990f 100644 --- a/src/Adapter/AdapterInterface.php +++ b/src/Adapter/AdapterInterface.php @@ -5,7 +5,6 @@ * @author Tinywan(ShaoBo Wan) * @date 2022/3/9 10:07 */ - declare(strict_types=1); namespace Tinywan\Storage\Adapter; diff --git a/src/Adapter/CosAdapter.php b/src/Adapter/CosAdapter.php index 66a3f9a..e8f6f63 100644 --- a/src/Adapter/CosAdapter.php +++ b/src/Adapter/CosAdapter.php @@ -1,13 +1,10 @@ setError(false, $e->getMessage()); } - $imgLen = strlen($base64['1']); $fileSize = $imgLen - ($imgLen / 8) * 2; @@ -120,9 +117,9 @@ public function uploadBase64(array $options) /** * @desc: 上传服务端文件 - * + * @param array $options + * @return array * @throws OssException - * * @author Tinywan(ShaoBo Wan) */ public function uploadServerFile(array $options = []): array diff --git a/src/Adapter/QiniuAdapter.php b/src/Adapter/QiniuAdapter.php index 7719149..d66bd8b 100644 --- a/src/Adapter/QiniuAdapter.php +++ b/src/Adapter/QiniuAdapter.php @@ -1,12 +1,9 @@