Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Profiler/Profile.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
23 private $token; | 23 private $token; |
24 | 24 |
25 /** | 25 /** |
26 * @var DataCollectorInterface[] | 26 * @var DataCollectorInterface[] |
27 */ | 27 */ |
28 private $collectors = array(); | 28 private $collectors = []; |
29 | 29 |
30 private $ip; | 30 private $ip; |
31 private $method; | 31 private $method; |
32 private $url; | 32 private $url; |
33 private $time; | 33 private $time; |
39 private $parent; | 39 private $parent; |
40 | 40 |
41 /** | 41 /** |
42 * @var Profile[] | 42 * @var Profile[] |
43 */ | 43 */ |
44 private $children = array(); | 44 private $children = []; |
45 | 45 |
46 /** | 46 /** |
47 * @param string $token The token | 47 * @param string $token The token |
48 */ | 48 */ |
49 public function __construct($token) | 49 public function __construct($token) |
72 } | 72 } |
73 | 73 |
74 /** | 74 /** |
75 * Sets the parent token. | 75 * Sets the parent token. |
76 */ | 76 */ |
77 public function setParent(Profile $parent) | 77 public function setParent(self $parent) |
78 { | 78 { |
79 $this->parent = $parent; | 79 $this->parent = $parent; |
80 } | 80 } |
81 | 81 |
82 /** | 82 /** |
90 } | 90 } |
91 | 91 |
92 /** | 92 /** |
93 * Returns the parent token. | 93 * Returns the parent token. |
94 * | 94 * |
95 * @return null|string The parent token | 95 * @return string|null The parent token |
96 */ | 96 */ |
97 public function getParentToken() | 97 public function getParentToken() |
98 { | 98 { |
99 return $this->parent ? $this->parent->getToken() : null; | 99 return $this->parent ? $this->parent->getToken() : null; |
100 } | 100 } |
202 * | 202 * |
203 * @param Profile[] $children | 203 * @param Profile[] $children |
204 */ | 204 */ |
205 public function setChildren(array $children) | 205 public function setChildren(array $children) |
206 { | 206 { |
207 $this->children = array(); | 207 $this->children = []; |
208 foreach ($children as $child) { | 208 foreach ($children as $child) { |
209 $this->addChild($child); | 209 $this->addChild($child); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 /** | 213 /** |
214 * Adds the child token. | 214 * Adds the child token. |
215 */ | 215 */ |
216 public function addChild(Profile $child) | 216 public function addChild(self $child) |
217 { | 217 { |
218 $this->children[] = $child; | 218 $this->children[] = $child; |
219 $child->setParent($this); | 219 $child->setParent($this); |
220 } | 220 } |
221 | 221 |
252 * | 252 * |
253 * @param DataCollectorInterface[] $collectors | 253 * @param DataCollectorInterface[] $collectors |
254 */ | 254 */ |
255 public function setCollectors(array $collectors) | 255 public function setCollectors(array $collectors) |
256 { | 256 { |
257 $this->collectors = array(); | 257 $this->collectors = []; |
258 foreach ($collectors as $collector) { | 258 foreach ($collectors as $collector) { |
259 $this->addCollector($collector); | 259 $this->addCollector($collector); |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
280 return isset($this->collectors[$name]); | 280 return isset($this->collectors[$name]); |
281 } | 281 } |
282 | 282 |
283 public function __sleep() | 283 public function __sleep() |
284 { | 284 { |
285 return array('token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode'); | 285 return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode']; |
286 } | 286 } |
287 } | 287 } |