woocommerce-paypal-payments/modules.local/ppcp-api-client/src/Entity/PatchCollection.php

33 lines
572 B
PHP
Raw Normal View History

2020-04-06 10:51:56 +03:00
<?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(
2020-04-06 11:16:18 +03:00
function (Patch $patch) : array {
2020-04-06 10:51:56 +03:00
return $patch->toArray();
},
$this->patches()
);
}
2020-04-06 11:16:18 +03:00
}