Skip to content

Commit f444507

Browse files
authored
[Fix] v1.2.4 TokenStorage only when MainRequest exists (#7)
* using token only when there is a master request * updated main branch name for ci * updated readme badge * fixed badge branch
1 parent 21eb1cb commit f444507

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
name: Continuous Integration
1+
name: GitHub Actions
32

43
on:
54
pull_request:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sblum Exception Enricher Bundle
22

3-
[![Build Status](https://travis-ci.org/sblum/exception-enricher.svg?branch=master)](https://travis-ci.org/sblum/exception-enricher)
3+
[![Build Status](https://github.com/sblum/exception-enricher/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/sblum/exception-enricher/actions)
44
[![Latest Stable Version](https://poser.pugx.org/sblum/exception-enricher/v/stable)](https://packagist.org/packages/sblum/exception-enricher)
55
[![License](https://poser.pugx.org/sblum/exception-enricher/license)](https://packagist.org/packages/sblum/exception-enricher)
66

src/ExceptionEnricher/Processor/ExceptionEnricherProcessor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public function __invoke(array $record): array
4747

4848
if ($this->requestStack->getMainRequest()) {
4949
$record['extra']['request_ip'] = $this->requestStack->getMainRequest()->getClientIp();
50-
}
51-
}
5250

53-
if ($this->tokenStorage && $this->tokenStorage->getToken()) {
54-
$record['extra']['username'] = $this->tokenStorage->getToken()->getUserIdentifier();
51+
if ($this->tokenStorage && $this->tokenStorage->getToken()) {
52+
$record['extra']['username'] = $this->tokenStorage->getToken()->getUserIdentifier();
53+
}
54+
}
5555
}
5656

5757
return $record;

0 commit comments

Comments
 (0)