I'm playing around with tomrf/htmx-message and to get a Request object, you need to do the following:
<?php
use Nyholm\Psr7\Factory\Psr17Factory;
use Nyholm\Psr7Server\ServerRequestCreator;
use Tomrf\HtmxMessage\HtmxServerRequest;
$psr17Factory = new Psr17Factory();
$creator = new ServerRequestCreator(
$psr17Factory, // ServerRequestFactory
$psr17Factory, // UriFactory
$psr17Factory, // UploadedFileFactory
$psr17Factory // StreamFactory
);
// Wrap the request with HTMX proxy.
$request = new HtmxServerRequest($creator->fromGlobals());
How could I override the parameter with a function call? (Or any other to build this dependency)
I'm playing around with
tomrf/htmx-messageand to get aRequestobject, you need to do the following:How could I override the parameter with a function call? (Or any other to build this dependency)