@@ -35,18 +35,12 @@ public function __wakeup(): void
35
35
parent ::__wakeup ();
36
36
}
37
37
38
- /**
39
- * {@inheritdoc}
40
- */
41
38
public function reset (): void
42
39
{
43
40
$ this ->data ['stacks ' ] = [];
44
41
$ this ->activeStack = null ;
45
42
}
46
43
47
- /**
48
- * {@inheritdoc}
49
- */
50
44
public function getName (): string
51
45
{
52
46
return 'httplug ' ;
@@ -95,7 +89,7 @@ public function addStack(Stack $stack)
95
89
*/
96
90
public function getChildrenStacks (Stack $ parent )
97
91
{
98
- return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->getParent () === $ parent );
92
+ return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->getParent () === $ parent );
99
93
}
100
94
101
95
/**
@@ -111,47 +105,43 @@ public function getStacks()
111
105
*/
112
106
public function getSuccessfulStacks ()
113
107
{
114
- return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => !$ stack ->isFailed ());
108
+ return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => !$ stack ->isFailed ());
115
109
}
116
110
117
111
/**
118
112
* @return Stack[]
119
113
*/
120
114
public function getFailedStacks ()
121
115
{
122
- return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->isFailed ());
116
+ return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->isFailed ());
123
117
}
124
118
125
119
/**
126
120
* @return array
127
121
*/
128
122
public function getClients ()
129
123
{
130
- $ stacks = array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => null === $ stack ->getParent ());
124
+ $ stacks = array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => null === $ stack ->getParent ());
131
125
132
- return array_unique (array_map (fn (Stack $ stack ) => $ stack ->getClient (), $ stacks ));
126
+ return array_unique (array_map (fn (Stack $ stack ) => $ stack ->getClient (), $ stacks ));
133
127
}
134
128
135
129
/**
136
- * @param $client
137
- *
138
130
* @return Stack[]
139
131
*/
140
132
public function getClientRootStacks ($ client )
141
133
{
142
- return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->getClient () == $ client && null == $ stack ->getParent ());
134
+ return array_filter ($ this ->data ['stacks ' ], fn (Stack $ stack ) => $ stack ->getClient () == $ client && null == $ stack ->getParent ());
143
135
}
144
136
145
137
/**
146
138
* Count all messages for a client.
147
139
*
148
- * @param $client
149
- *
150
140
* @return int
151
141
*/
152
142
public function countClientMessages ($ client )
153
143
{
154
- return array_sum (array_map (fn (Stack $ stack ) => $ this ->countStackMessages ($ stack ), $ this ->getClientRootStacks ($ client )));
144
+ return array_sum (array_map (fn (Stack $ stack ) => $ this ->countStackMessages ($ stack ), $ this ->getClientRootStacks ($ client )));
155
145
}
156
146
157
147
/**
@@ -161,20 +151,17 @@ public function countClientMessages($client)
161
151
*/
162
152
private function countStackMessages (Stack $ stack )
163
153
{
164
- return 1 + array_sum (array_map (fn (Stack $ child ) => $ this ->countStackMessages ($ child ), $ this ->getChildrenStacks ($ stack )));
154
+ return 1 + array_sum (array_map (fn (Stack $ child ) => $ this ->countStackMessages ($ child ), $ this ->getChildrenStacks ($ stack )));
165
155
}
166
156
167
157
/**
168
158
* @return int
169
159
*/
170
160
public function getTotalDuration ()
171
161
{
172
- return array_reduce ($ this ->data ['stacks ' ], fn ($ carry , Stack $ stack ) => $ carry + $ stack ->getDuration (), 0 );
162
+ return array_reduce ($ this ->data ['stacks ' ], fn ($ carry , Stack $ stack ) => $ carry + $ stack ->getDuration (), 0 );
173
163
}
174
164
175
- /**
176
- * {@inheritdoc}
177
- */
178
165
public function collect (Request $ request , Response $ response , $ exception = null ): void
179
166
{
180
167
// We do not need to collect any data from the Symfony Request and Response
0 commit comments