Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Profiler/Profiler.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
9 * file that was distributed with this source code. | 9 * file that was distributed with this source code. |
10 */ | 10 */ |
11 | 11 |
12 namespace Symfony\Component\HttpKernel\Profiler; | 12 namespace Symfony\Component\HttpKernel\Profiler; |
13 | 13 |
14 use Psr\Log\LoggerInterface; | |
14 use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; | 15 use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; |
15 use Symfony\Component\HttpFoundation\Request; | 16 use Symfony\Component\HttpFoundation\Request; |
16 use Symfony\Component\HttpFoundation\Response; | 17 use Symfony\Component\HttpFoundation\Response; |
17 use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; | 18 use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; |
18 use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; | 19 use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; |
19 use Psr\Log\LoggerInterface; | |
20 | 20 |
21 /** | 21 /** |
22 * Profiler. | 22 * Profiler. |
23 * | 23 * |
24 * @author Fabien Potencier <fabien@symfony.com> | 24 * @author Fabien Potencier <fabien@symfony.com> |
28 private $storage; | 28 private $storage; |
29 | 29 |
30 /** | 30 /** |
31 * @var DataCollectorInterface[] | 31 * @var DataCollectorInterface[] |
32 */ | 32 */ |
33 private $collectors = array(); | 33 private $collectors = []; |
34 | 34 |
35 private $logger; | 35 private $logger; |
36 private $initiallyEnabled = true; | 36 private $initiallyEnabled = true; |
37 private $enabled = true; | 37 private $enabled = true; |
38 | 38 |
101 $collector->lateCollect(); | 101 $collector->lateCollect(); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 if (!($ret = $this->storage->write($profile)) && null !== $this->logger) { | 105 if (!($ret = $this->storage->write($profile)) && null !== $this->logger) { |
106 $this->logger->warning('Unable to store the profiler information.', array('configured_storage' => get_class($this->storage))); | 106 $this->logger->warning('Unable to store the profiler information.', ['configured_storage' => \get_class($this->storage)]); |
107 } | 107 } |
108 | 108 |
109 return $ret; | 109 return $ret; |
110 } | 110 } |
111 | 111 |
196 /** | 196 /** |
197 * Sets the Collectors associated with this profiler. | 197 * Sets the Collectors associated with this profiler. |
198 * | 198 * |
199 * @param DataCollectorInterface[] $collectors An array of collectors | 199 * @param DataCollectorInterface[] $collectors An array of collectors |
200 */ | 200 */ |
201 public function set(array $collectors = array()) | 201 public function set(array $collectors = []) |
202 { | 202 { |
203 $this->collectors = array(); | 203 $this->collectors = []; |
204 foreach ($collectors as $collector) { | 204 foreach ($collectors as $collector) { |
205 $this->add($collector); | 205 $this->add($collector); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |