PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / vendor / vendor-prefixed / stellarwp / licensing-api-client / src / Requests / Credit / DeletePool.php

DeletePool.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at vendor/vendor-prefixed/stellarwp/licensing-api-client/src/Requests/Credit/DeletePool.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare(strict_types=1);
2
3 namespace Give\Vendors\LiquidWeb\LicensingApiClient\Requests\Credit;
4
5 use DateTimeImmutable;
6 use Give\Vendors\LiquidWeb\LicensingApiClient\Concerns\InteractsWithDateTime;
7
8 /**
9 * Represents a credit pool delete request payload.
10 *
11 * @phpstan-type DeletePoolPayload array{
12 * license_key: string,
13 * pool_id: int,
14 * expires_at?: string
15 * }
16 */
17 final class DeletePool
18 {
19 use InteractsWithDateTime;
20
21 /**
22 * License key that owns the credit pool.
23 *
24 * @example LWSW-8H9F-5UKA-VR3B-D7SQ-BP9N
25 */
26 public string $licenseKey;
27
28 /**
29 * Credit pool identifier to delete.
30 *
31 * @example 42
32 */
33 public int $poolId;
34
35 /**
36 * Optional expiration timestamp to soft-delete the pool at a specific time.
37 *
38 * @example 2026-04-01T00:00:00Z
39 */
40 public ?DateTimeImmutable $expiresAt;
41
42 public function __construct(string $licenseKey, int $poolId, ?DateTimeImmutable $expiresAt = null) {
43 $this->licenseKey = $licenseKey;
44 $this->poolId = $poolId;
45 $this->expiresAt = $expiresAt;
46 }
47
48 /**
49 * @return DeletePoolPayload
50 */
51 public function toArray(): array {
52 return array_filter([
53 'license_key' => $this->licenseKey,
54 'pool_id' => $this->poolId,
55 'expires_at' => $this->expiresAt ? $this->formatDateTime($this->expiresAt) : null,
56 ], static fn ($value): bool => $value !== null);
57 }
58 }
59