PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / square / square / src / Legacy / Models / DeviceComponentDetailsCardReaderDetails.php

DeviceComponentDetailsCardReaderDetails.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/DeviceComponentDetailsCardReaderDetails.php

58 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Square\Legacy\Models;
6
7 use stdClass;
8
9 class DeviceComponentDetailsCardReaderDetails implements \JsonSerializable
10 {
11 /**
12 * @var string|null
13 */
14 private $version;
15
16 /**
17 * Returns Version.
18 * The version of the card reader.
19 */
20 public function getVersion(): ?string
21 {
22 return $this->version;
23 }
24
25 /**
26 * Sets Version.
27 * The version of the card reader.
28 *
29 * @maps version
30 */
31 public function setVersion(?string $version): void
32 {
33 $this->version = $version;
34 }
35
36 /**
37 * Encode this object to JSON
38 *
39 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
40 * are set. (default: false)
41 *
42 * @return array|stdClass
43 */
44 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
45 public function jsonSerialize(bool $asArrayWhenEmpty = false)
46 {
47 $json = [];
48 if (isset($this->version)) {
49 $json['version'] = $this->version;
50 }
51 $json = array_filter($json, function ($val) {
52 return $val !== null;
53 });
54
55 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
56 }
57 }
58