Skip to content

Replacement for container-interop #37

Open
@boesing

Description

Hey there,

I am working on laminas/laminas-servicemanager#96 and realized that it would be quite simple to fully replace the abandoned package container-interop/container-interop by using some composer magic:

https://github.com/laminas/laminas-servicemanager/pull/96/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R87
https://github.com/laminas/laminas-servicemanager/pull/96/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R52
https://github.com/laminas/laminas-servicemanager/pull/96/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R61


When adding the autoload file to the autoloader like this, all packages type-hinting against the container-interop interfaces will still work and thus, no one will get composer warnings of the abandoned package container-interop/container-interop anymore.

<?php

declare(strict_types=1);

use Interop\Container\Containerinterface as InteropContainerInterface;
use Interop\Container\Exception\ContainerException as InteropContainerException;
use Interop\Container\Exception\NotFoundException as InteropNotFoundException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

class_alias(ContainerInterface::class, InteropContainerInterface::class);
class_alias(ContainerExceptionInterface::class, InteropContainerException::class);
class_alias(NotFoundExceptionInterface::class, InteropNotFoundException::class);

In v1.2.0, container-interop only extends the PSR-Interfaces and has no own methods.


Is this something which would be considered by this component? I know its not the usual way of handling such problems but I'd say it would be "cleaner" in this component than in the laminas/laminas-servicemanager component.

Feedback welcome.
If this is not something you want to do in this package, feel free to close this issue as invalid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions