8000 [PM-11133] Eliminate some static variable warnings by KatherineInCode · Pull Request #850 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-11133] Eliminate some static variable warnings #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10000
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Networking
struct CaptchaRequestModel: JSONRequestBody {
// MARK: Static Properties

static var encoder = JSONEncoder()
static let encoder = JSONEncoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Networking
struct DeleteAccountRequestModel: JSONRequestBody {
// MARK: Static Properties

static var encoder = JSONEncoder()
static let encoder = JSONEncoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Networking
struct ResendEmailCodeRequestModel: JSONRequestBody {
// MARK: Static Properties

static var encoder = JSONEncoder()
static let encoder = JSONEncoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Networking
struct SingleSignOnDetailsRequestModel: JSONRequestBody {
// MARK: Static Properties

static var encoder = JSONEncoder()
static let encoder = JSONEncoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Networking
struct TrustedDeviceKeysRequestModel: JSONRequestBody, Equatable {
// MARK: Properties

static var encoder = JSONEncoder()
static let encoder = JSONEncoder()

/// The encrypted private key used in a `TrustedDeviceKeysRequest`.
let encryptedPrivateKey: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// The response returned from the API upon creating an account.
///
struct CreateAccountResponseModel: JSONResponse {
static var decoder = JSONDecoder()
static let decoder = JSONDecoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ struct ErrorResponseModel: Codable, Equatable {
// MARK: JSONResponse

extension ErrorResponseModel: JSONResponse {
static var decoder = JSONDecoder.pascalOrSnakeCaseDecoder
static let decoder = JSONDecoder.pascalOrSnakeCaseDecoder
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Networking
/// API response model for the identity token refresh request.
///
struct IdentityTokenRefreshResponseModel: JSONResponse, Equatable {
static var decoder = JSONDecoder.snakeCaseDecoder
static let decoder = JSONDecoder.snakeCaseDecoder

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Networking
/// API response model for the identity token request.
///
struct IdentityTokenResponseModel: Equatable, JSONResponse, KdfConfigProtocol {
static var decoder = JSONDecoder.pascalOrSnakeCaseDecoder
static let decoder = JSONDecoder.pascalOrSnakeCaseDecoder

// MARK: Account Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Networking

/// An object containing a value defining if this device has previously logged into this account or not.
struct KnownDeviceResponseModel: JSONResponse {
static var decoder = JSONDecoder()
static let decoder = JSONDecoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// A data structure representing a login request.
///
public struct LoginRequest: JSONResponse, Equatable {
public static var decoder = JSONDecoder.defaultDecoder
public static let decoder = JSONDecoder.defaultDecoder

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// The response returned from the API when requesting the pending login requests.
///
struct PendingLoginsResponse: JSONResponse {
static var decoder = JSONDecoder.defaultDecoder
static let decoder = JSONDecoder.defaultDecoder

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// The response returned from the API upon pre-validating the single-sign on.
///
struct PreValidateSingleSignOnResponse: JSONResponse, Equatable {
static var decoder = JSONDecoder()
static let decoder = JSONDecoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// The response returned from the API upon creating an account.
///
struct RegisterFinishResponseModel: JSONResponse {
static var decoder = JSONDecoder()
static let decoder = JSONDecoder()

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ struct ErrorModel: Codable, Equatable {
// MARK: JSONResponse

extension ResponseValidationErrorModel: JSONResponse {
static var decoder = JSONDecoder.pascalOrSnakeCaseDecoder
static let decoder = JSONDecoder.pascalOrSnakeCaseDecoder
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Networking
/// The response returned from the API when requesting the single sign on details.
///
struct SingleSignOnDetailsResponse: JSONResponse, Equatable {
static var decoder = JSONDecoder.pascalOrSnakeCaseDecoder
static let decoder = JSONDecoder.pascalOrSnakeCaseDecoder

// MARK: Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public extension Logger {

/// The Logger subsystem passed along with logs to the logging system to identify logs from this
/// application.
private static var subsystem = Bundle.main.bundleIdentifier!
private static let subsystem = Bundle.main.bundleIdentifier!
}
2 changes: 1 addition & 1 deletion BitwardenShared/Core/Platform/Models/Enum/AppTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import UIKit

/// An enum listing the display theme options.
///
public enum AppTheme: String, Menuable {
public enum AppTheme: String, Menuable, Sendable {
/// Use the dark theme.
case dark

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation

/// An enum listing all the language options, either default (system settings) or any of the currently available
/// localizable files.
public enum LanguageOption: Equatable {
public enum LanguageOption: Equatable, Sendable {
/// Use the system settings.
case `default`

Expand Down
2 changes: 1 addition & 1 deletion BitwardenShared/Core/Tools/Models/Enum/SendType.swift
Original file line number Di 10000 ff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BitwardenSdk

/// An enum describing the type of data in a send.
///
public enum SendType: Int, CaseIterable, Codable, Equatable, Menuable {
public enum SendType: Int, CaseIterable, Codable, Equatable, Menuable, Sendable {
/// The send contains text data.
case text = 0

Expand Down
2 changes: 1 addition & 1 deletion BitwardenShared/Core/Vault/Models/Enum/CipherType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension CipherType {
}

extension CipherType: CaseIterable {
static var allCases: [CipherType] = [.login, .card, .identity, .secureNote]
static let allCases: [CipherType] = [.login, .card, .identity, .secureNote]
}

extension CipherType: Menuable {
Expand Down
2 changes: 1 addition & 1 deletion BitwardenShared/Core/Vault/Models/Enum/TitleType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ enum TitleType: String, Codable, Equatable, Hashable, Menuable {
}

extension TitleType: CaseIterable {
static var allCases: [TitleType] = [.mr, .mrs, .ms, .mx, .dr]
static let allCases: [TitleType] = [.mr, .mrs, .ms, .mx, .dr]
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ struct ProfileSwitcherRow: View {

#if DEBUG
extension ProfileSwitcherItem {
static var unlockedAccountPreview = ProfileSwitcherItem(
static let unlockedAccountPreview = ProfileSwitcherItem(
color: .purple,
email: "anne.account@bitwarden.com",
isUnlocked: true,
Expand All @@ -259,7 +259,7 @@ extension ProfileSwitcherItem {
webVault: "bitwarden.com"
)

static var lockedAccountPreview = ProfileSwitcherItem(
static let lockedAccountPreview = ProfileSwitcherItem(
color: .purple,
email: "anne.account@bitwarden.com",
isUnlocked: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum UnlockMethod {

/// An enumeration of session timeout values to choose from.
///
public enum SessionTimeoutValue: RawRepresentable, CaseIterable, Equatable, Menuable {
public enum SessionTimeoutValue: RawRepresentable, CaseIterable, Equatable, Menuable, Sendable {
/// Timeout immediately.
case immediately

Expand Down Expand Up @@ -141,7 +141,7 @@ public enum SessionTimeoutValue: RawRepresentable, CaseIterable, Equatable, Menu

/// The action to perform on session timeout.
///
public enum SessionTimeoutAction: Int, CaseIterable, Codable, Equatable, Menuable {
public enum SessionTimeoutAction: Int, CaseIterable, Codable, Equatable, Menuable, Sendable {
/// Lock the vault.
case lock = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/// The type of value to generate.
///
public enum GeneratorType: CaseIterable, Equatable, Menuable {
public enum GeneratorType: CaseIterable, Equatable, Menuable, Sendable {
/// Generate a password or passphrase.
case password

Expand Down
Loading
0