mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Enforce array elements type for Payments constructor
This commit is contained in:
parent
ff4f3d2bba
commit
5fda97307b
2 changed files with 2 additions and 5 deletions
|
@ -8,10 +8,7 @@ class Payments
|
|||
{
|
||||
private $authorizations;
|
||||
|
||||
/**
|
||||
* @var Authorization[] $authorizations
|
||||
*/
|
||||
public function __construct(array $authorizations)
|
||||
public function __construct(Authorization ...$authorizations)
|
||||
{
|
||||
$this->authorizations = $authorizations;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class PaymentsFactory
|
|||
},
|
||||
$data->authorizations
|
||||
);
|
||||
$payments = new Payments($authorizations);
|
||||
$payments = new Payments(...$authorizations);
|
||||
return $payments;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue