Skip to content

Commit

Permalink
fix: PHP 7.4 support (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksandr Prypkhan <[email protected]>
  • Loading branch information
sausman and oprypkhantc authored May 25, 2020
1 parent 2cc0924 commit 62054f8
Show file tree
Hide file tree
Showing 81 changed files with 367 additions and 364 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ dwolla-swagger-php

The new Dwolla API V2 SDK, as generated by [this fork of swagger-codegen](https://github.com/mach-kernel/swagger-codegen).

Additionally, temporary PHP 7.4 support was added using these replaces:
- `\$this\->([a-z0-9\_]+) = \$data\["([a-z0-9\_]+)"\]\;` into `\$this->$1 = \$data\["$2"\] ?? null;`

## Version

1.3.0
Expand Down
8 changes: 4 additions & 4 deletions lib/models/AccountInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class AccountInfo implements ArrayAccess {
public $_embedded; /* object */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->id = $data["id"];
$this->name = $data["name"];
$this->_embedded = $data["_embedded"];
$this->_links = $data["_links"] ?? null;
$this->id = $data["id"] ?? null;
$this->name = $data["name"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/AccountOAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class AccountOAuthToken implements ArrayAccess {
public $token; /* string */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->token = $data["token"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->token = $data["token"] ?? null;
}

public function offsetExists($offset) {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/AddLabelLedgerEntryRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AddLabelLedgerEntryRequest implements ArrayAccess {
public $amount; /* Amount */

public function __construct(array $data = null) {
$this->amount = $data["amount"];
$this->amount = $data["amount"] ?? null;
}

public function offsetExists($offset) {
Expand Down
14 changes: 7 additions & 7 deletions lib/models/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class Address implements ArrayAccess {
public $postal_code; /* string */

public function __construct(array $data = null) {
$this->address1 = $data["address1"];
$this->address2 = $data["address2"];
$this->address3 = $data["address3"];
$this->city = $data["city"];
$this->state_province_region = $data["state_province_region"];
$this->country = $data["country"];
$this->postal_code = $data["postal_code"];
$this->address1 = $data["address1"] ?? null;
$this->address2 = $data["address2"] ?? null;
$this->address3 = $data["address3"] ?? null;
$this->city = $data["city"] ?? null;
$this->state_province_region = $data["state_province_region"] ?? null;
$this->country = $data["country"] ?? null;
$this->postal_code = $data["postal_code"] ?? null;
}

public function offsetExists($offset) {
Expand Down
4 changes: 2 additions & 2 deletions lib/models/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class Amount implements ArrayAccess {
public $currency; /* string */

public function __construct(array $data = null) {
$this->value = $data["value"];
$this->currency = $data["currency"];
$this->value = $data["value"] ?? null;
$this->currency = $data["currency"] ?? null;
}

public function offsetExists($offset) {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/AnswerKbaQuestionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AnswerKbaQuestionsRequest implements ArrayAccess {
public $answers; /* array[AnsweredKbaQuestion] */

public function __construct(array $data = null) {
$this->answers = $data["answers"];
$this->answers = $data["answers"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/AnswerKbaQuestionsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class AnswerKbaQuestionsResponse implements ArrayAccess {
public $_embedded; /* map[string,Number] */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->verification_status = $data["verification_status"];
$this->_embedded = $data["_embedded"];
$this->_links = $data["_links"] ?? null;
$this->verification_status = $data["verification_status"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
}

public function offsetExists($offset) {
Expand Down
4 changes: 2 additions & 2 deletions lib/models/AnsweredKbaQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class AnsweredKbaQuestion implements ArrayAccess {
public $answer_id; /* string */

public function __construct(array $data = null) {
$this->question_id = $data["question_id"];
$this->answer_id = $data["answer_id"];
$this->question_id = $data["question_id"] ?? null;
$this->answer_id = $data["answer_id"] ?? null;
}

public function offsetExists($offset) {
Expand Down
12 changes: 6 additions & 6 deletions lib/models/ApplicationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class ApplicationEvent implements ArrayAccess {
public $resource_id; /* string */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->id = $data["id"];
$this->created = $data["created"];
$this->topic = $data["topic"];
$this->resource_id = $data["resource_id"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->id = $data["id"] ?? null;
$this->created = $data["created"] ?? null;
$this->topic = $data["topic"] ?? null;
$this->resource_id = $data["resource_id"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/BeneficialOwnerListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class BeneficialOwnerListResponse implements ArrayAccess {
public $total; /* int */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->total = $data["total"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->total = $data["total"] ?? null;
}

public function offsetExists($offset) {
Expand Down
8 changes: 4 additions & 4 deletions lib/models/BusinessClassification.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class BusinessClassification implements ArrayAccess {
public $name; /* string */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->id = $data["id"];
$this->name = $data["name"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->id = $data["id"] ?? null;
$this->name = $data["name"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/BusinessClassificationListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class BusinessClassificationListResponse implements ArrayAccess {
public $total; /* int */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->total = $data["total"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->total = $data["total"] ?? null;
}

public function offsetExists($offset) {
Expand Down
4 changes: 2 additions & 2 deletions lib/models/CatalogResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class CatalogResponse implements ArrayAccess {
public $_embedded; /* object */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
}

public function offsetExists($offset) {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/CertifyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CertifyRequest implements ArrayAccess {
public $status; /* string */

public function __construct(array $data = null) {
$this->status = $data["status"];
$this->status = $data["status"] ?? null;
}

public function offsetExists($offset) {
Expand Down
4 changes: 2 additions & 2 deletions lib/models/Clearing.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class Clearing implements ArrayAccess {
public $destination; /* string */

public function __construct(array $data = null) {
$this->source = $data["source"];
$this->destination = $data["destination"];
$this->source = $data["source"] ?? null;
$this->destination = $data["destination"] ?? null;
}

public function offsetExists($offset) {
Expand Down
42 changes: 21 additions & 21 deletions lib/models/CreateCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ class CreateCustomer implements ArrayAccess {
public $correlation_id; /* string */

public function __construct(array $data = null) {
$this->first_name = $data["first_name"];
$this->last_name = $data["last_name"];
$this->email = $data["email"];
$this->ip_address = $data["ip_address"];
$this->type = $data["type"];
$this->address1 = $data["address1"];
$this->address2 = $data["address2"];
$this->city = $data["city"];
$this->state = $data["state"];
$this->postal_code = $data["postal_code"];
$this->date_of_birth = $data["date_of_birth"];
$this->ssn = $data["ssn"];
$this->phone = $data["phone"];
$this->business_name = $data["business_name"];
$this->business_type = $data["business_type"];
$this->business_classification = $data["business_classification"];
$this->ein = $data["ein"];
$this->doing_business_as = $data["doing_business_as"];
$this->website = $data["website"];
$this->controller = $data["controller"];
$this->correlation_id = $data["correlation_id"];
$this->first_name = $data["first_name"] ?? null;
$this->last_name = $data["last_name"] ?? null;
$this->email = $data["email"] ?? null;
$this->ip_address = $data["ip_address"] ?? null;
$this->type = $data["type"] ?? null;
$this->address1 = $data["address1"] ?? null;
$this->address2 = $data["address2"] ?? null;
$this->city = $data["city"] ?? null;
$this->state = $data["state"] ?? null;
$this->postal_code = $data["postal_code"] ?? null;
$this->date_of_birth = $data["date_of_birth"] ?? null;
$this->ssn = $data["ssn"] ?? null;
$this->phone = $data["phone"] ?? null;
$this->business_name = $data["business_name"] ?? null;
$this->business_type = $data["business_type"] ?? null;
$this->business_classification = $data["business_classification"] ?? null;
$this->ein = $data["ein"] ?? null;
$this->doing_business_as = $data["doing_business_as"] ?? null;
$this->website = $data["website"] ?? null;
$this->controller = $data["controller"] ?? null;
$this->correlation_id = $data["correlation_id"] ?? null;
}

public function offsetExists($offset) {
Expand Down
2 changes: 1 addition & 1 deletion lib/models/CreateCustomerLabelRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CreateCustomerLabelRequest implements ArrayAccess {
public $amount; /* Amount */

public function __construct(array $data = null) {
$this->amount = $data["amount"];
$this->amount = $data["amount"] ?? null;
}

public function offsetExists($offset) {
Expand Down
16 changes: 8 additions & 8 deletions lib/models/CreateFundingSourceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ class CreateFundingSourceRequest implements ArrayAccess {
public $channels; /* array[string] */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->routing_number = $data["routing_number"];
$this->account_number = $data["account_number"];
$this->type = $data["type"];
$this->bank_account_type = $data["bank_account_type"];
$this->name = $data["name"];
$this->verified = $data["verified"];
$this->channels = $data["channels"];
$this->_links = $data["_links"] ?? null;
$this->routing_number = $data["routing_number"] ?? null;
$this->account_number = $data["account_number"] ?? null;
$this->type = $data["type"] ?? null;
$this->bank_account_type = $data["bank_account_type"] ?? null;
$this->name = $data["name"] ?? null;
$this->verified = $data["verified"] ?? null;
$this->channels = $data["channels"] ?? null;
}

public function offsetExists($offset) {
Expand Down
12 changes: 6 additions & 6 deletions lib/models/CreateOwnerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class CreateOwnerRequest implements ArrayAccess {
public $passport; /* Passport */

public function __construct(array $data = null) {
$this->first_name = $data["first_name"];
$this->last_name = $data["last_name"];
$this->ssn = $data["ssn"];
$this->date_of_birth = $data["date_of_birth"];
$this->address = $data["address"];
$this->passport = $data["passport"];
$this->first_name = $data["first_name"] ?? null;
$this->last_name = $data["last_name"] ?? null;
$this->ssn = $data["ssn"] ?? null;
$this->date_of_birth = $data["date_of_birth"] ?? null;
$this->address = $data["address"] ?? null;
$this->passport = $data["passport"] ?? null;
}

public function offsetExists($offset) {
Expand Down
4 changes: 2 additions & 2 deletions lib/models/CreateWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class CreateWebhook implements ArrayAccess {
public $secret; /* string */

public function __construct(array $data = null) {
$this->url = $data["url"];
$this->secret = $data["secret"];
$this->url = $data["url"] ?? null;
$this->secret = $data["secret"] ?? null;
}

public function offsetExists($offset) {
Expand Down
40 changes: 20 additions & 20 deletions lib/models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,26 @@ class Customer implements ArrayAccess {
public $correlation_id; /* string */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->id = $data["id"];
$this->first_name = $data["first_name"];
$this->last_name = $data["last_name"];
$this->email = $data["email"];
$this->type = $data["type"];
$this->status = $data["status"];
$this->created = $data["created"];
$this->address1 = $data["address1"];
$this->address2 = $data["address2"];
$this->city = $data["city"];
$this->state = $data["state"];
$this->postal_code = $data["postal_code"];
$this->phone = $data["phone"];
$this->business_name = $data["business_name"];
$this->doing_business_as = $data["doing_business_as"];
$this->website = $data["website"];
$this->controller = $data["controller"];
$this->correlation_id = $data["correlation_id"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->id = $data["id"] ?? null;
$this->first_name = $data["first_name"] ?? null;
$this->last_name = $data["last_name"] ?? null;
$this->email = $data["email"] ?? null;
$this->type = $data["type"] ?? null;
$this->status = $data["status"] ?? null;
$this->created = $data["created"] ?? null;
$this->address1 = $data["address1"] ?? null;
$this->address2 = $data["address2"] ?? null;
$this->city = $data["city"] ?? null;
$this->state = $data["state"] ?? null;
$this->postal_code = $data["postal_code"] ?? null;
$this->phone = $data["phone"] ?? null;
$this->business_name = $data["business_name"] ?? null;
$this->doing_business_as = $data["doing_business_as"] ?? null;
$this->website = $data["website"] ?? null;
$this->controller = $data["controller"] ?? null;
$this->correlation_id = $data["correlation_id"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/CustomerListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class CustomerListResponse implements ArrayAccess {
public $total; /* int */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->total = $data["total"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->total = $data["total"] ?? null;
}

public function offsetExists($offset) {
Expand Down
6 changes: 3 additions & 3 deletions lib/models/CustomerOAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class CustomerOAuthToken implements ArrayAccess {
public $token; /* string */

public function __construct(array $data = null) {
$this->_links = $data["_links"];
$this->_embedded = $data["_embedded"];
$this->token = $data["token"];
$this->_links = $data["_links"] ?? null;
$this->_embedded = $data["_embedded"] ?? null;
$this->token = $data["token"] ?? null;
}

public function offsetExists($offset) {
Expand Down
Loading

0 comments on commit 62054f8

Please sign in to comment.