PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 All 166 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / MonitorSchedule.php

MonitorSchedule.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.21, at vendor_prefixed/sentry/sentry/src/MonitorSchedule.php

82 lines 2.0 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 namespace WCPOS\Vendor\Sentry;
5
6 final class MonitorSchedule
7 {
8 /**
9 * @var string The type of the schedule
10 */
11 private $type;
12 /**
13 * @var string|int The value of the schedule
14 */
15 private $value;
16 /**
17 * @var MonitorScheduleUnit|null The unit of the schedule
18 */
19 private $unit;
20 public const TYPE_CRONTAB = 'crontab';
21 public const TYPE_INTERVAL = 'interval';
22 /**
23 * @param string $type The type of the schedule
24 * @param string|int $value The value of the schedule
25 * @param MonitorScheduleUnit|null $unit The unit of the schedule
26 */
27 public function __construct(string $type, $value, ?MonitorScheduleUnit $unit = null)
28 {
29 $this->type = $type;
30 $this->value = $value;
31 $this->unit = $unit;
32 }
33 public static function crontab(string $value) : self
34 {
35 return new self(self::TYPE_CRONTAB, $value);
36 }
37 public static function interval(int $value, MonitorScheduleUnit $unit) : self
38 {
39 return new self(self::TYPE_INTERVAL, $value, $unit);
40 }
41 public function getType() : string
42 {
43 return $this->type;
44 }
45 public function setType(string $type) : self
46 {
47 $this->type = $type;
48 return $this;
49 }
50 /**
51 * @return string|int
52 */
53 public function getValue()
54 {
55 return $this->value;
56 }
57 /**
58 * @param string|int $value
59 */
60 public function setValue($value) : self
61 {
62 $this->value = $value;
63 return $this;
64 }
65 public function getUnit() : ?MonitorScheduleUnit
66 {
67 return $this->unit;
68 }
69 public function setUnit(?MonitorScheduleUnit $unit) : self
70 {
71 $this->unit = $unit;
72 return $this;
73 }
74 /**
75 * @return array<string, string|int>
76 */
77 public function toArray() : array
78 {
79 return ['type' => $this->type, 'value' => $this->value, 'unit' => (string) $this->unit];
80 }
81 }
82