Skip to content

Inject with non-scalar value? #17

Description

@ellisgl

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions