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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Add ConfigProvider #37

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

jakejohns
Copy link
Contributor

Q A
New Feature yes

Description

Add a ConfigProvider and package config that will map PSR-17 HTTP Factory interfaces to the Diactoros implementations when used with compatible container implementation.

Example:

$responseFactory = $container->get(\Psr\Http\Message\ResponseFactoryInterface::class);

Allows, for example, Request Handler factories to request interfaces from the container. eg:

declare(strict_types=1);

namespace My\Module\Handler;

use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseFactoryInterface;

class FooHandlerFactory
{
    public function __invoke(ContainerInterface $container) : FooHandler
    {
        return new FooHandler(
            $container->get(ResponseFactoryInterface::class)
        );
    }
}

@jakejohns jakejohns changed the base branch from master to develop March 9, 2020 01:25
Maps PSR-17 HTTP Factory interfaces to Diactoros implementations
@jakejohns jakejohns force-pushed the feature/config-provider branch from 9bb1470 to 2504e45 Compare March 11, 2020 16:11
weierophinney added a commit that referenced this pull request Apr 27, 2020
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
@weierophinney weierophinney merged commit d3dc0df into laminas:develop Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants