cryptoInterface = $apiCrypto; break; case 'jwt': $jwtCrypto = new JwtCrypto(); $this->cryptoInterface = $jwtCrypto; break; case 'admin-jwt': $jwtCrypto = new JwtCrypto(); $this->cryptoInterface = $jwtCrypto; $this->cryptoInterface->type = $type; break; case 'admin-password': $adminCrypto = new AdminPasswordCrypto(); $this->cryptoInterface = $adminCrypto; $this->cryptoInterface->salt = $key; break; default: throw new Exception('The encryption algorithm does not exist'); } $this->cryptoInterface->data = $dataStr; return $this->cryptoInterface; } }