Skip to content

Commit

Permalink
Merge pull request #740 from Adyen/format-project-github-action
Browse files Browse the repository at this point in the history
Release 4.6.0: Format project
  • Loading branch information
nauaros authored Dec 21, 2021
2 parents 4364e2c + 6abbbab commit 630e207
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,9 @@ open class AbstractPersonalInformationComponent: PaymentComponent, PresentableCo
/// :nodoc:
public var phoneItem: FormPhoneNumberItem? { phoneItemInjector?.item }

private lazy var selectableValues: [PhoneExtensionPickerItem] = {
getPhoneExtensions().map {
PhoneExtensionPickerItem(identifier: $0.countryCode, element: $0)
}
}()
private lazy var selectableValues: [PhoneExtensionPickerItem] = getPhoneExtensions().map {
PhoneExtensionPickerItem(identifier: $0.countryCode, element: $0)
}

/// The button item.
internal lazy var button: FormButtonItem = {
Expand Down
4 changes: 1 addition & 3 deletions Adyen/UI/List/ListFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ internal final class ListFooterView: UIView {
return stackView
}()

private lazy var titleContainerView: UIView = {
titleBackgroundView.adyen.wrapped(with: UIEdgeInsets(top: 12, left: 16, bottom: -12, right: -16))
}()
private lazy var titleContainerView: UIView = titleBackgroundView.adyen.wrapped(with: UIEdgeInsets(top: 12, left: 16, bottom: -12, right: -16))

private lazy var separatorView: UIView = {
let view = UIView()
Expand Down
8 changes: 2 additions & 6 deletions Adyen/Utilities/BundleSPMExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ internal extension Bundle {
// swiftlint:disable explicit_acl

/// The main bundle of the framework.
static let core: Bundle = {
Bundle(for: FormView.self)
}()
static let core: Bundle = .init(for: FormView.self)

/// The bundle in which the framework's resources are located.
static let coreInternalResources: Bundle = {
Bundle.module
}()
static let coreInternalResources: Bundle = .module

// swiftlint:enable explicit_acl
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import Foundation
extension Bundle {

/// The main bundle of the framework.
internal static let core: Bundle = {
Bundle(for: FormView.self)
}()
internal static let core: Bundle = .init(for: FormView.self)

/// The bundle in which the framework's resources are located.
internal static let coreInternalResources: Bundle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension ADYTransaction: AnyADYTransaction {
internal func performChallenge(with parameters: ADYChallengeParameters,
completionHandler: @escaping (AnyChallengeResult?, Error?) -> Void) {
performChallenge(with: parameters,
completionHandler: { (result: ADYChallengeResult?, error: Error?) -> Void in
completionHandler: { (result: ADYChallengeResult?, error: Error?) in
completionHandler(result, error)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ internal class ShareableVoucherView: UIView, Localizable {
return label
}()

private lazy var amountLabel: UILabel = {
createLabel(with: model.style.amount, text: model.amount, identifier: "amountLabel")
}()
private lazy var amountLabel: UILabel = createLabel(with: model.style.amount, text: model.amount, identifier: "amountLabel")

private lazy var logoView: UIImageView = {
let imageView = UIImageView()
Expand Down
8 changes: 2 additions & 6 deletions AdyenActions/Utilities/BundleSPMExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ internal extension Bundle {
// swiftlint:disable explicit_acl

/// The main bundle of the framework.
static let core: Bundle = {
Bundle(for: RedirectComponent.self)
}()
static let core: Bundle = .init(for: RedirectComponent.self)

/// The bundle in which the framework's resources are located.
static let actionsInternalResources: Bundle = {
Bundle.module
}()
static let actionsInternalResources: Bundle = .module

// swiftlint:enable explicit_acl
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import Foundation
extension Bundle {

/// The main bundle of the framework.
internal static let actions: Bundle = {
Bundle(for: RedirectComponent.self)
}()
internal static let actions: Bundle = .init(for: RedirectComponent.self)

/// The bundle in which the framework's resources are located.
internal static let actionsInternalResources: Bundle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public final class GiftCardComponent: PartialPaymentComponent,
// MARK: - Presentable Component Protocol

/// :nodoc:
public lazy var viewController: UIViewController = {
SecuredViewController(child: formViewController, style: style)
}()
public lazy var viewController: UIViewController = SecuredViewController(child: formViewController, style: style)

/// :nodoc:
public var requiresModalPresentation: Bool { true }
Expand Down
4 changes: 1 addition & 3 deletions AdyenCard/Form/Installments/FormCardInstallmentsItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ internal final class FormCardInstallmentsItem: BaseFormPickerItem<InstallmentEle
}

/// Default picker option.
private lazy var oneTimePaymentElement: InstallmentElement = {
InstallmentElement(kind: .plan(.oneTime), localizationParameters: localizationParameters)
}()
private lazy var oneTimePaymentElement: InstallmentElement = .init(kind: .plan(.oneTime), localizationParameters: localizationParameters)

/// Creates the picker values to display in addition to `oneTimePaymentElement`
private var additionalPickerElements: [InstallmentElement] {
Expand Down
4 changes: 1 addition & 3 deletions AdyenCard/Utilities/BundleSPMExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ internal extension Bundle {
// swiftlint:disable explicit_acl

/// The bundle in which the framework's resources are located.
static let cardInternalResources: Bundle = {
Bundle.module
}()
static let cardInternalResources: Bundle = .module

// swiftlint:enable explicit_acl
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import Foundation
extension Bundle {

/// The main bundle of the framework.
private static let cardBundle: Bundle = {
Bundle(for: CardComponent.self)
}()
private static let cardBundle: Bundle = .init(for: CardComponent.self)

/// The bundle in which the framework's resources are located.
internal static var cardInternalResources: Bundle {
Expand Down
8 changes: 3 additions & 5 deletions AdyenComponents/BLIK/BLIKComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ public final class BLIKComponent: PaymentComponent, PresentableComponent, Locali
}()

/// The helper message item.
internal lazy var hintLabelItem: FormLabelItem = {
FormLabelItem(text: localizedString(.blikHelp, localizationParameters),
style: style.hintLabel,
identifier: ViewIdentifierBuilder.build(scopeInstance: self, postfix: "blikCodeHintLabel"))
}()
internal lazy var hintLabelItem: FormLabelItem = .init(text: localizedString(.blikHelp, localizationParameters),
style: style.hintLabel,
identifier: ViewIdentifierBuilder.build(scopeInstance: self, postfix: "blikCodeHintLabel"))

/// The BLIK code item.
internal lazy var codeItem: FormTextInputItem = {
Expand Down
8 changes: 2 additions & 6 deletions AdyenDropIn/Views/ModalToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,9 @@ internal final class ModalToolbar: UIView, AnyNavigationBar {
])
}

private lazy var safeAreaLeadingAnchor: NSLayoutXAxisAnchor = {
style.toolbarMode == .natural ? safeAreaLayoutGuide.leadingAnchor : safeAreaLayoutGuide.leftAnchor
}()
private lazy var safeAreaLeadingAnchor: NSLayoutXAxisAnchor = style.toolbarMode == .natural ? safeAreaLayoutGuide.leadingAnchor : safeAreaLayoutGuide.leftAnchor

private lazy var safeAreaTrailingAnchor: NSLayoutXAxisAnchor = {
style.toolbarMode == .natural ? safeAreaLayoutGuide.trailingAnchor : safeAreaLayoutGuide.rightAnchor
}()
private lazy var safeAreaTrailingAnchor: NSLayoutXAxisAnchor = style.toolbarMode == .natural ? safeAreaLayoutGuide.trailingAnchor : safeAreaLayoutGuide.rightAnchor

private lazy var cancelPositionConstraint: NSLayoutConstraint = {
let cancelPositionConstraint: NSLayoutConstraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BACSConfirmationPresenterProtocolMock: BACSConfirmationPresenterProtocol {

var startLoadingCallsCount = 0
var startLoadingCalled: Bool {
return startLoadingCallsCount > 0
startLoadingCallsCount > 0
}

func startLoading() {
Expand All @@ -31,7 +31,7 @@ class BACSConfirmationPresenterProtocolMock: BACSConfirmationPresenterProtocol {

var stopLoadingCallsCount = 0
var stopLoadingCalled: Bool {
return stopLoadingCallsCount > 0
stopLoadingCallsCount > 0
}

func stopLoading() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ class BACSConfirmationViewProtocolMock: BACSConfirmationViewProtocol {

var setUserInteractionEnabledCallsCount = 0
var setUserInteractionEnabledCalled: Bool {
return setUserInteractionEnabledCallsCount > 0
setUserInteractionEnabledCallsCount > 0
}

var setUserInteractionEnabledReceivedValue: Bool?

func setUserInteraction(enabled: Bool) {
Expand All @@ -22,18 +23,18 @@ class BACSConfirmationViewProtocolMock: BACSConfirmationViewProtocol {

var addItemCallsCount = 0
var addItemCalled: Bool {
return addItemCallsCount > 0
addItemCallsCount > 0
}

func add<T>(item: T?) where T : FormItem {
func add<T>(item: T?) where T: FormItem {
addItemCallsCount += 1
}

// MARK: - displayValidation

var displayValidationCallsCount = 0
var displayValidationCalled: Bool {
return displayValidationCallsCount > 0
displayValidationCallsCount > 0
}

func displayValidation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BACSDirectDebitComponentTrackerProtocolMock: BACSDirectDebitComponentTrack

var sendEventCallsCount = 0
var sendEventCalled: Bool {
return sendEventCallsCount > 0
sendEventCallsCount > 0
}

func sendEvent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BACSInputFormViewProtocolMock: BACSInputFormViewProtocol {

var setupNavigationBarCallsCount = 0
var setupNavigationBarCalled: Bool {
return setupNavigationBarCallsCount > 0
setupNavigationBarCallsCount > 0
}

func setupNavigationBar() {
Expand All @@ -20,18 +20,18 @@ class BACSInputFormViewProtocolMock: BACSInputFormViewProtocol {

var addItemCallsCount = 0
var addItemCalled: Bool {
return addItemCallsCount > 0
addItemCallsCount > 0
}

func add<T>(item: T?) where T : FormItem {
func add<T>(item: T?) where T: FormItem {
addItemCallsCount += 1
}

// MARK: - displayValidation

var displayValidationCallsCount = 0
var displayValidationCalled: Bool {
return displayValidationCallsCount > 0
displayValidationCallsCount > 0
}

func displayValidation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class BACSInputPresenterProtocolMock: BACSInputPresenterProtocol {

var resetFormCallsCount = 0
var restFormCalled: Bool {
return resetFormCallsCount > 0
resetFormCallsCount > 0
}

func resetForm() {
resetFormCallsCount += 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createHolderNameItemCallsCount = 0
var createHolderNameItemCalled: Bool {
return createHolderNameItemCallsCount > 0
createHolderNameItemCallsCount > 0
}

var createHolderNameItemReturnValue: FormTextInputItem!

func createHolderNameItem() -> FormTextInputItem {
Expand All @@ -22,8 +23,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createBankAccountNumberItemCallsCount = 0
var createBankAccountNumberItemCalled: Bool {
return createBankAccountNumberItemCallsCount > 0
createBankAccountNumberItemCallsCount > 0
}

var createBankAccountNumberItemReturnValue: FormTextInputItem!

func createBankAccountNumberItem() -> FormTextInputItem {
Expand All @@ -35,8 +37,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createSortCodeItemCallsCount = 0
var createSortCodeItemCalled: Bool {
return createSortCodeItemCallsCount > 0
createSortCodeItemCallsCount > 0
}

var createSortCodeItemReturnValue: FormTextInputItem!

func createSortCodeItem() -> FormTextInputItem {
Expand All @@ -48,8 +51,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createEmailItemCallsCount = 0
var createEmailItemCalled: Bool {
return createEmailItemCallsCount > 0
createEmailItemCallsCount > 0
}

var createEmailItemReturnValue: FormTextInputItem!

func createEmailItem() -> FormTextInputItem {
Expand All @@ -61,8 +65,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createContinueButtonCallsCount = 0
var createContinueButtonCalled: Bool {
return createContinueButtonCallsCount > 0
createContinueButtonCallsCount > 0
}

var createContinueButtonReturnValue: FormButtonItem!

func createContinueButton() -> FormButtonItem {
Expand All @@ -74,8 +79,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createPaymentButtonCallsCount = 0
var createPaymentButtonCalled: Bool {
return createPaymentButtonCallsCount > 0
createPaymentButtonCallsCount > 0
}

var createPaymentButtonReturnValue: FormButtonItem!

func createPaymentButton() -> FormButtonItem {
Expand All @@ -87,7 +93,7 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createAmountConsentToggleAmountCallsCount = 0
var createAmountConsentToggleAmountCalled: Bool {
return createAmountConsentToggleAmountCallsCount > 0
createAmountConsentToggleAmountCallsCount > 0
}

var createAmountConsentToggleAmountReturnValue: FormToggleItem!
Expand All @@ -103,8 +109,9 @@ class BACSItemsFactoryProtocolMock: BACSItemsFactoryProtocol {

var createLegalConsentToggleCallsCount = 0
var createLegalConsentToggleCalled: Bool {
return createLegalConsentToggleCallsCount > 0
createLegalConsentToggleCallsCount > 0
}

var createLegalConsentToggleReturnValue: FormToggleItem!
func createLegalConsentToggle() -> FormToggleItem {
createLegalConsentToggleCallsCount += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class BACSRouterProtocolMock: BACSDirectDebitRouterProtocol {

var presentConfirmationWithDataCallsCount = 0
var presentConfirmationWithDataCalled: Bool {
return presentConfirmationWithDataCallsCount > 0
presentConfirmationWithDataCallsCount > 0
}

var presentConfirmationWithDataReceivedData: BACSDirectDebitData?

func presentConfirmation(with data: BACSDirectDebitData) {
Expand All @@ -29,8 +30,9 @@ class BACSRouterProtocolMock: BACSDirectDebitRouterProtocol {

var confirmPaymentWithDataCallsCount = 0
var confirmPaymentWithDataCalled: Bool {
return confirmPaymentWithDataCallsCount > 0
confirmPaymentWithDataCallsCount > 0
}

var confirmPaymentWithDataReceivedData: BACSDirectDebitData?

func confirmPayment(with data: BACSDirectDebitData) {
Expand All @@ -42,7 +44,7 @@ class BACSRouterProtocolMock: BACSDirectDebitRouterProtocol {

var cancelPaymentCallsCount = 0
var cancelPaymentCalled: Bool {
return cancelPaymentCallsCount > 0
cancelPaymentCallsCount > 0
}

func cancelPayment() {
Expand Down
Loading

0 comments on commit 630e207

Please sign in to comment.