From fe33c1a7ba0b2b6a662f156f7745d2caa1cc6cb1 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Wed, 10 Nov 2021 14:46:16 +0800 Subject: [PATCH] Fix getMetadata error League\Flysystem\FileAttributes::__construct(): Argument #4 ($lastModified) must be of type ?int, string given --- src/CosAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CosAdapter.php b/src/CosAdapter.php index 1d1273c..63b99a0 100644 --- a/src/CosAdapter.php +++ b/src/CosAdapter.php @@ -178,9 +178,9 @@ public function getMetadata($path): ?FileAttributes return new FileAttributes( $path, - $meta['Content-Length'][0] ?? null, + isset($meta['Content-Length'][0]) ? \strtotime($meta['Content-Length'][0]) : null, null, - $meta['Last-Modified'][0] ?? null, + isset($meta['Last-Modified'][0]) ? \strtotime($meta['Last-Modified'][0]) : null, $meta['Content-Type'][0] ?? null, ); }