瀏覽代碼

Update HashidService.php

fix php 7.4 requirement, which causes the error `ERROR: Array and string offset access syntax with curly braces is deprecated {"userId":1,"exception":"[object] (ErrorException(code: 0): Array and string offset access syntax with curly braces is deprecated at /var/www/ap
p/Services/HashidService.php:24)`
Strubbl 5 年之前
父節點
當前提交
8aa97dec0c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Services/HashidService.php

+ 2 - 2
app/Services/HashidService.php

@@ -21,7 +21,7 @@ class HashidService {
 			$shortcode = '';
 			$shortcode = '';
 			while($id) {
 			while($id) {
 				$id = ($id - ($r = $id % $base)) / $base;
 				$id = ($id - ($r = $id % $base)) / $base;
-				$shortcode = $cmap{$r} . $shortcode;
+				$shortcode = $cmap[$r] . $shortcode;
 			};
 			};
 			return $shortcode;
 			return $shortcode;
 		});
 		});
@@ -47,4 +47,4 @@ class HashidService {
 		return $id;
 		return $id;
 	}
 	}
 
 
-}
+}