map(function ($twofaccount, $key) use ($storage) { if ($storage->contains(function ($value, $key) use ($twofaccount) { return $value->secret == $twofaccount->secret && $value->service == $twofaccount->service && $value->account == $twofaccount->account && $value->otp_type == $twofaccount->otp_type && $value->digits == $twofaccount->digits && $value->algorithm == $twofaccount->algorithm; })) { $twofaccount->id = -1; } return $twofaccount; }); return $twofaccounts; } }