You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since my last issue, I am working (and systematically failing BTW) on supporting ServerRequests in the same fashion of Requests so that I can feed it something like $request = GuzzleHttp\Psr7\ServerRequest::fromGlobals();
Create a new method at \Deviantintegral\Har\Request::fromPsr7ServerRequest(ServerRequestInterface $source), mirroring \Deviantintegral\Har\Request::fromPsr7Request(). This would adapt a ServerRequest into something that can be represented in a HAR.
Create a new class in src/Adapter/Psr7/ for a ServerRequest to adapt a HAR request back into a ServerRequest. You'll likely want to extend from \Deviantintegral\Har\Adapter\Psr7\MessageBase, implementing \Psr\Http\Message\RequestInterface, noting that we should clone the original object to prevent accidental changes to it like is done at \Deviantintegral\Har\Adapter\Psr7\Request::__construct().
Does that help? Feel free to open a PR as you work on this.
I copied \Deviantintegral\Har\Request to \Deviantintegral\Har\ServerRequest and made some adaptation (with also fromPsr7ServerRequest).
Also already created the new adapter, but I'm desperately trying to avoid to have to implement ServerRequestInterface by extending GuzzleHttp\Psr7\ServerRequest. Unfortunately the datamodel is fairly different, so I might just go the way you suggested.
If you find value in the feature and want to take over the effort, feel free to implement it yourself any time. I'll open a PR if I get somewhere!
Since my last issue, I am working (and systematically failing BTW) on supporting ServerRequests in the same fashion of Requests so that I can feed it something like
$request = GuzzleHttp\Psr7\ServerRequest::fromGlobals();
For docs: https://www.php-fig.org/psr/psr-7/#321-psrhttpmessageserverrequestinterface
Any comment/advice is welcome.
Thank you!
The text was updated successfully, but these errors were encountered: