Skip to content

Copy of container-interop/service-providers for usage in personal projects.

Notifications You must be signed in to change notification settings

jascha030/service-provider

Repository files navigation

Service Provider

Copy of container-interop/service-providers, which seems unmaintained, but states that is still a work in progress. Because of this, I made a copy with some slight edits, to use in personal projects.

Installation

composer require jascha030/service-provider

The interface

The interface is pretty self explainitory, read the README.md of container-interop/service-providers for more info.

<?php

declare(strict_types=1);

namespace Jascha030\DI\ServiceProvider;

use Closure;
use Psr\Container\ContainerInterface;

/**
 * A service provider provides entries to a container.
 *
 * @see ContainerInterface
 */
interface ServiceProviderInterface
{
    /**
     * @return iterable<class-string|int|string,callable|Closure>
     */
    public function getFactories(): iterable;

    /**
     * @return iterable<class-string|int|string,callable|Closure>
     */
    public function getExtensions(): iterable;
}

About

Copy of container-interop/service-providers for usage in personal projects.

Topics

Resources

Stars

Watchers

Forks

Languages