PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.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 All 257 releases
give / vendor / vendor-prefixed / stellarwp / licensing-api-client / src / Responses / ValueObjects / PaginationLinks.php

PaginationLinks.php in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at vendor/vendor-prefixed/stellarwp/licensing-api-client/src/Responses/ValueObjects/PaginationLinks.php

66 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\Responses\ValueObjects;
4
5 use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Contracts\Response;
6
7 /**
8 * @implements Response<array{
9 * first: string,
10 * last: string|null,
11 * prev: string|null,
12 * next: string|null
13 * }>
14 */
15 final class PaginationLinks implements Response
16 {
17 public string $first;
18
19 public ?string $last;
20
21 public ?string $prev;
22
23 public ?string $next;
24
25 private function __construct(string $first, ?string $last, ?string $prev, ?string $next) {
26 $this->first = $first;
27 $this->last = $last;
28 $this->prev = $prev;
29 $this->next = $next;
30 }
31
32 /**
33 * @param array{
34 * first: string,
35 * last: string|null,
36 * prev: string|null,
37 * next: string|null
38 * } $attributes
39 */
40 public static function from(array $attributes): self {
41 return new self(
42 $attributes['first'],
43 $attributes['last'],
44 $attributes['prev'],
45 $attributes['next']
46 );
47 }
48
49 /**
50 * @return array{
51 * first: string,
52 * last: string|null,
53 * prev: string|null,
54 * next: string|null
55 * }
56 */
57 public function toArray(): array {
58 return [
59 'first' => $this->first,
60 'last' => $this->last,
61 'prev' => $this->prev,
62 'next' => $this->next,
63 ];
64 }
65 }
66