tus-php
tus-php copied to clipboard
Allow to pass an existing request object in constructor
The current implementation always creates the HTTP request from the superglobals:
public function __construct()
{
if (null === $this->request) {
$this->request = HttpRequest::createFromGlobals();
}
}
But this is not always possible (e.g. when using RoadRunner). It's also an issue in combination with other frameworks (see #440).
With this pull request, users can pass their own Symfony HTTP request object in the constructor - if necessary.
Of course one could also extend the Request class and do the same. But this would also require extending the Server class.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 99.60%. Comparing base (a466a9b) to head (41acd14).
Additional details and impacted files
@@ Coverage Diff @@
## main #442 +/- ##
=========================================
Coverage 99.60% 99.60%
Complexity 362 362
=========================================
Files 20 20
Lines 1007 1008 +1
=========================================
+ Hits 1003 1004 +1
Misses 4 4
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.