Skip to content

Commit

Permalink
minor #27975 [MonologBridge] Improve FirePHPHandler (dunglas)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.8 branch.

Discussion
----------

[MonologBridge] Improve FirePHPHandler

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |n/a
| License       | MIT
| Doc PR        | n/a

Fix a call to a parent static property. Remove a useless call to `getRequest()`

Commits
-------

1d93b5e [MonologBridge] Improve FirePHPHandler
  • Loading branch information
fabpot committed Jul 18, 2018
2 parents efc4fb3 + 1d93b5e commit 0902337
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php
Expand Up @@ -38,9 +38,10 @@ public function onKernelResponse(FilterResponseEvent $event)
return;
}

if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))
&& !$event->getRequest()->headers->has('X-FirePHP-Version')) {
$this->sendHeaders = false;
$request = $event->getRequest();
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $request->headers->get('User-Agent'))
&& !$request->headers->has('X-FirePHP-Version')) {
self::$sendHeaders = false;
$this->headers = array();

return;
Expand All @@ -58,7 +59,7 @@ public function onKernelResponse(FilterResponseEvent $event)
*/
protected function sendHeader($header, $content)
{
if (!$this->sendHeaders) {
if (!self::$sendHeaders) {
return;
}

Expand Down

0 comments on commit 0902337

Please sign in to comment.