Possibility to use service as person_fn rather than a static function #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR allow to use service as
person_fn
I created PersonProvider service that is used by default
To use custom person provider you need to define your own service with alias
rollbar.person-provider
in services.yml of your application, for example:No need to define
person_fn
option (thx to DI), the service will be used automatically, but ifperson_fn
is defined, then it will be usedLogic of obtaining user info is not changed.
I've also discovered, that
security.token_storage
andserializer
are private and cannot be obtained from container, so I passed it toRollbar\Symfony\RollbarBundle\Factories\RollbarHandlerFactory
constructorType of change
Related issues
Checklists
Development
Code review
I tested these changes on symfony 5.4 and symfony 6.4, it works well
@danielmorell could you please take a look on it?