diff options
Diffstat (limited to 'vendor/symfony/http-kernel/Profiler/Profiler.php')
| -rw-r--r-- | vendor/symfony/http-kernel/Profiler/Profiler.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/symfony/http-kernel/Profiler/Profiler.php b/vendor/symfony/http-kernel/Profiler/Profiler.php index 4a32c78420..87a4996392 100644 --- a/vendor/symfony/http-kernel/Profiler/Profiler.php +++ b/vendor/symfony/http-kernel/Profiler/Profiler.php @@ -63,12 +63,12 @@ class Profiler implements ResetInterface /** * Loads the Profile for the given Response. * - * @return Profile|false A Profile instance + * @return Profile|null A Profile instance */ public function loadProfileFromResponse(Response $response) { if (!$token = $response->headers->get('X-Debug-Token')) { - return false; + return null; } return $this->loadProfile($token); @@ -79,7 +79,7 @@ class Profiler implements ResetInterface * * @param string $token A token * - * @return Profile A Profile instance + * @return Profile|null A Profile instance */ public function loadProfile($token) { @@ -128,7 +128,7 @@ class Profiler implements ResetInterface * * @return array An array of tokens * - * @see http://php.net/manual/en/datetime.formats.php for the supported date/time formats + * @see https://php.net/datetime.formats for the supported date/time formats */ public function find($ip, $url, $limit, $method, $start, $end, $statusCode = null) { @@ -143,7 +143,7 @@ class Profiler implements ResetInterface public function collect(Request $request, Response $response, \Exception $exception = null) { if (false === $this->enabled) { - return; + return null; } $profile = new Profile(substr(hash('sha256', uniqid(mt_rand(), true)), 0, 6)); @@ -242,16 +242,16 @@ class Profiler implements ResetInterface return $this->collectors[$name]; } - private function getTimestamp($value) + private function getTimestamp(?string $value): ?int { - if (null === $value || '' == $value) { - return; + if (null === $value || '' === $value) { + return null; } try { $value = new \DateTime(is_numeric($value) ? '@'.$value : $value); } catch (\Exception $e) { - return; + return null; } return $value->getTimestamp(); |
