浏览代码

Fix syntax unsupported by php7.4

Bubka 3 年之前
父节点
当前提交
0345ca86ad
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Models/TwoFAccount.php

+ 3 - 2
app/Models/TwoFAccount.php

@@ -313,8 +313,9 @@ class TwoFAccount extends Model implements Sortable
      * 
      * 
      * @throws InvalidSecretException The secret is not a valid base32 encoded string
      * @throws InvalidSecretException The secret is not a valid base32 encoded string
      * @throws UndecipherableException The secret cannot be deciphered
      * @throws UndecipherableException The secret cannot be deciphered
+     * @return TotpDto|HotpDto 
      */
      */
-    public function getOTP() : TotpDto|HotpDto
+    public function getOTP()
     {
     {
         Log::info(sprintf('OTP requested for TwoFAccount #%s', $this->id));
         Log::info(sprintf('OTP requested for TwoFAccount #%s', $this->id));
 
 
@@ -461,7 +462,7 @@ class TwoFAccount extends Model implements Sortable
      */
      */
     private function getGeneratorOtpType()
     private function getGeneratorOtpType()
     {
     {
-        return Arr::get($this->generatorClassMap, $this->generator::class);
+        return Arr::get($this->generatorClassMap, get_class($this->generator));
     }
     }
 
 
     /**
     /**