Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to interfaces #36

Merged
merged 2 commits into from
Feb 8, 2021
Merged

Refactor to interfaces #36

merged 2 commits into from
Feb 8, 2021

Conversation

bilfeldt
Copy link
Contributor

@bilfeldt bilfeldt commented Feb 8, 2021

This PR is the first one which addresses some of the notes mentioned in #35

This PR introduce two new interfaces:

  • src/TrackingFilterInterface.php: Used to check whether or not a given request should be logged.
  • src/TrackingLoggerInterface.php: Used to log the request

And two concrete implementations of these new interfaces:

  • src/TrackingFilter.php
  • src/TrackingLogger.php

Where the content of the two concrete classes are directly copy-pasted from the src/Middleware/CaptureAttributionDataMiddleware.php which is now significantly slimmer 馃憤

Tests

This PR also implements basic tests for the middleware and empty tests for the two concrete classes described above (no tests were implemented before).

An an abstract TestCase class was introduced and some modifications to the file structure and dev requirements had to be made for the tests to be implemented.

@kyranb kyranb merged commit 5c8979a into kyranb:master Feb 8, 2021
@kyranb
Copy link
Owner

kyranb commented Feb 8, 2021

Thanks so much 馃槃

@bilfeldt bilfeldt deleted the feature/refactor-to-interfaces branch February 9, 2021 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants