FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sentry-php/src/MonitorSchedule.php at source-frame-cache · getsentry/sentry-php · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
getsentry
/
sentry-php
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
475
Star
1.9k
Code
Issues
20
Pull requests
11
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
sentry-php
/
src
/
MonitorSchedule.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
106 lines (86 loc) · 2.05 KB
Breadcrumbs
sentry-php
/
src
/
MonitorSchedule.php
Copy path
File metadata and controls
106 lines (86 loc) · 2.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
declare
(strict_types=
1
);
namespace
Sentry
;
final
class
MonitorSchedule
{
/**
* @var string The type of the schedule
*/
private
$
type
;
/**
* @var string|int The value of the schedule
*/
private
$
value
;
/**
* @var MonitorScheduleUnit|null The unit of the schedule
*/
private
$
unit
;
public
const
TYPE_CRONTAB
=
'
crontab
'
;
public
const
TYPE_INTERVAL
=
'
interval
'
;
/**
* @param string $type The type of the schedule
* @param string|int $value The value of the schedule
* @param MonitorScheduleUnit|null $unit The unit of the schedule
*/
public
function
__construct
(
string
$
type
,
$
value
,
?
MonitorScheduleUnit
$
unit
=
null
) {
$
this
->
type
=
$
type
;
$
this
->
value
=
$
value
;
$
this
->
unit
=
$
unit
;
}
public
static
function
crontab
(
string
$
value
):
self
{
return
new
self
(
self
::
TYPE_CRONTAB
,
$
value
);
}
public
static
function
interval
(
int
$
value
,
MonitorScheduleUnit
$
unit
):
self
{
return
new
self
(
self
::
TYPE_INTERVAL
,
$
value
,
$
unit
);
}
public
function
getType
():
string
{
return
$
this
->
type
;
}
public
function
setType
(
string
$
type
):
self
{
$
this
->
type
=
$
type
;
return
$
this
;
}
/**
* @return string|int
*/
public
function
getValue
()
{
return
$
this
->
value
;
}
/**
* @param string|int $value
*/
public
function
setValue
(
$
value
):
self
{
$
this
->
value
=
$
value
;
return
$
this
;
}
public
function
getUnit
(): ?
MonitorScheduleUnit
{
return
$
this
->
unit
;
}
public
function
setUnit
(?
MonitorScheduleUnit
$
unit
):
self
{
$
this
->
unit
=
$
unit
;
return
$
this
;
}
/**
* @return array<string, string|int>
*/
public
function
toArray
():
array
{
return
[
'
type
'
=>
$
this
->
type
,
'
value
'
=>
$
this
->
value
,
'
unit
'
=> (
string
)
$
this
->
unit
,
];
}
}
Back
|
FazBrowse Home
|
New Git URL