upgraded dependencies
This commit is contained in:
@@ -20,12 +20,12 @@ use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final since Symfony 4.4
|
||||
* @final
|
||||
*/
|
||||
class TimeDataCollector extends DataCollector implements LateDataCollectorInterface
|
||||
{
|
||||
protected $kernel;
|
||||
protected $stopwatch;
|
||||
private $kernel;
|
||||
private $stopwatch;
|
||||
|
||||
public function __construct(KernelInterface $kernel = null, Stopwatch $stopwatch = null)
|
||||
{
|
||||
@@ -35,10 +35,8 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param \Throwable|null $exception
|
||||
*/
|
||||
public function collect(Request $request, Response $response/* , \Throwable $exception = null */)
|
||||
public function collect(Request $request, Response $response, \Throwable $exception = null)
|
||||
{
|
||||
if (null !== $this->kernel) {
|
||||
$startTime = $this->kernel->getStartTime();
|
||||
@@ -78,8 +76,6 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the request events.
|
||||
*
|
||||
* @param StopwatchEvent[] $events The request events
|
||||
*/
|
||||
public function setEvents(array $events)
|
||||
@@ -92,21 +88,17 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request events.
|
||||
*
|
||||
* @return StopwatchEvent[] The request events
|
||||
* @return StopwatchEvent[]
|
||||
*/
|
||||
public function getEvents()
|
||||
public function getEvents(): array
|
||||
{
|
||||
return $this->data['events'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request elapsed time.
|
||||
*
|
||||
* @return float The elapsed time
|
||||
*/
|
||||
public function getDuration()
|
||||
public function getDuration(): float
|
||||
{
|
||||
if (!isset($this->data['events']['__section__'])) {
|
||||
return 0;
|
||||
@@ -121,10 +113,8 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
* Gets the initialization time.
|
||||
*
|
||||
* This is the time spent until the beginning of the request handling.
|
||||
*
|
||||
* @return float The elapsed time
|
||||
*/
|
||||
public function getInitTime()
|
||||
public function getInitTime(): float
|
||||
{
|
||||
if (!isset($this->data['events']['__section__'])) {
|
||||
return 0;
|
||||
@@ -133,20 +123,12 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
return $this->data['events']['__section__']->getOrigin() - $this->getStartTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request time.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getStartTime()
|
||||
public function getStartTime(): float
|
||||
{
|
||||
return $this->data['start_time'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool whether or not the stopwatch component is installed
|
||||
*/
|
||||
public function isStopwatchInstalled()
|
||||
public function isStopwatchInstalled(): bool
|
||||
{
|
||||
return $this->data['stopwatch_installed'];
|
||||
}
|
||||
@@ -154,7 +136,7 @@ class TimeDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return 'time';
|
||||
}
|
||||
|
Reference in New Issue
Block a user