FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpbench/lib/Executor/ExecutionContext.php at program-executor · phpbench/phpbench · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
phpbench
/
phpbench
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
132
Star
2k
Code
Issues
28
Pull requests
10
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpbench
/
lib
/
Executor
/
ExecutionContext.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
184 lines (157 loc) · 4.02 KB
Breadcrumbs
phpbench
/
lib
/
Executor
/
ExecutionContext.php
Copy path
File metadata and controls
184 lines (157 loc) · 4.02 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
namespace
PhpBench
\
Executor
;
use
PhpBench
\
Benchmark
\
Metadata
\
SubjectMetadata
;
use
PhpBench
\
Model
\
Iteration
;
use
PhpBench
\
Model
\
ParameterSet
;
final
class
ExecutionContext
{
/**
* @var string
*/
private
$
className
;
/**
* @var ParameterSet
*/
private
$
parameters
;
/**
* @var string
*/
private
$
classPath
;
/**
* @var int
*/
private
$
iterationIndex
;
/**
* @var int
*/
private
$
warmup
;
/**
* @var array<string>
*/
private
$
afterMethods
;
/**
* @var array<string>
*/
private
$
beforeMethods
;
/**
* @var int
*/
private
$
revolutions
;
/**
* @var string
*/
private
$
methodName
;
/**
* @var float|null
*/
private
$
timeOut
;
/**
* @var string
*/
private
$
parameterSetName
;
/**
* @param ParameterSet|array<string,mixed>|null $parameters The type array is deprecated and will be removed in 2.0
* @param string[] $beforeMethods
* @param string[] $afterMethods
*/
public
function
__construct
(
string
$
className
,
string
$
classPath
,
string
$
methodName
,
int
$
revolutions
=
1
,
array
$
beforeMethods
= [],
array
$
afterMethods
= [],
$
parameters
=
null
,
int
$
warmup
=
0
,
int
$
iterationIndex
=
0
,
?
float
$
timeOut
=
null
,
string
$
parameterSetName
=
''
) {
$
this
->
className
=
$
className
;
$
this
->
classPath
=
$
classPath
;
$
this
->
methodName
=
$
methodName
;
$
this
->
revolutions
=
$
revolutions
;
$
this
->
beforeMethods
=
$
beforeMethods
;
$
this
->
afterMethods
=
$
afterMethods
;
$
this
->
parameters
=
$
parameters
instanceof
ParameterSet ?
$
parameters
: ParameterSet::
fromUnserializedValues
(
'
default
'
,
$
parameters
?? []);
$
this
->
warmup
=
$
warmup
;
$
this
->
iterationIndex
=
$
iterationIndex
;
$
this
->
timeOut
=
$
timeOut
;
$
this
->
parameterSetName
=
$
parameterSetName
;
}
public
static
function
fromSubjectMetadataAndIteration
(
SubjectMetadata
$
subjectMetadata
,
Iteration
$
iteration
):
self
{
return
new
self
(
$
subjectMetadata
->
getBenchmark
()->
getClass
(),
$
subjectMetadata
->
getBenchmark
()->
getPath
(),
$
subjectMetadata
->
getName
(),
$
iteration
->
getVariant
()->
getRevolutions
(),
$
subjectMetadata
->
getBeforeMethods
(),
$
subjectMetadata
->
getAfterMethods
(),
$
iteration
->
getVariant
()->
getParameterSet
(),
$
iteration
->
getVariant
()->
getWarmup
() ?:
0
,
$
iteration
->
getIndex
(),
$
subjectMetadata
->
getTimeout
(),
$
iteration
->
getVariant
()->
getParameterSet
()->
getName
()
);
}
public
function
getClassName
():
string
{
return
$
this
->
className
;
}
/**
* @deprecated Use getParameterSet will be removed in PHPBench 2.0
*
* @return parameters
*/
public
function
getParameters
():
array
{
return
$
this
->
parameters
->
toUnserializedParameters
();
}
public
function
getParameterSet
():
ParameterSet
{
return
$
this
->
parameters
;
}
public
function
getClassPath
():
string
{
return
$
this
->
classPath
;
}
public
function
getIterationIndex
():
int
{
return
$
this
->
iterationIndex
;
}
public
function
getWarmup
():
int
{
return
$
this
->
warmup
;
}
/**
* @return string[]
*/
public
function
getAfterMethods
():
array
{
return
$
this
->
afterMethods
;
}
/**
* @return string[]
*/
public
function
getBeforeMethods
():
array
{
return
$
this
->
beforeMethods
;
}
public
function
getRevolutions
():
int
{
return
$
this
->
revolutions
;
}
public
function
getMethodName
():
string
{
return
$
this
->
methodName
;
}
public
function
getTimeOut
(): ?
float
{
return
$
this
->
timeOut
;
}
public
function
getParameterSetName
():
string
{
return
$
this
->
parameterSetName
;
}
}
Back
|
FazBrowse Home
|
New Git URL