mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
32 lines
572 B
PHP
32 lines
572 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Inpsyde\PayPalCommerce\ApiClient\Entity;
|
|
|
|
class PatchCollection
|
|
{
|
|
|
|
private $patches;
|
|
public function __construct(Patch ...$patches)
|
|
{
|
|
$this->patches = $patches;
|
|
}
|
|
|
|
/**
|
|
* @return Patch[]
|
|
*/
|
|
public function patches() : array
|
|
{
|
|
return $this->patches;
|
|
}
|
|
|
|
public function toArray() : array
|
|
{
|
|
return array_map(
|
|
function (Patch $patch) : array {
|
|
return $patch->toArray();
|
|
},
|
|
$this->patches()
|
|
);
|
|
}
|
|
}
|