Skip to content

usage of PSR-11? #19

Closed
Closed

Description

@aristotelesweb

This codeception plugin uses Interop\Container\ContainerInterface. According to the github page of Interop:
"Starting Feb. 13th 2017, container-interop is officially deprecated in favor of PSR-11. Container-interop has been the test-bed of PSR-11. From v1.2, container-interop directly extends PSR-11 interfaces. Therefore, all containers implementing container-interop are now de-facto compatible with PSR-11."

Is it possible to use Psr\Container\ContainerInterface instead of Interop\Container\ContainerInterface?
(Interop\Container\ContainerInterface uses also PSR-11)

Thanks in advance!

Activity

  1. mairo744 commented on Aug 5, 2025

    @mairo744

    It looks like laminas/laminas-servicemanager v4+ has officially dropped support for the deprecated Interop\Container\ContainerInterface and now strictly implements Psr\Container\ContainerInterface.

    As a result, when trying to update to laminas/laminas-servicemanager v4, tests start to fail due to the Mezzio module in Codeception still type-hinting against the legacy Interop\Container\ContainerInterface:

    TypeError: Cannot assign Laminas\ServiceManager\ServiceManager to property Codeception\Lib\Connector\Mezzio::$container of type Interop\Container\ContainerInterface in /var/www/vendor/codeception/module-mezzio/src/Codeception/Lib/Connector/Mezzio.php:144
    

    Since container-interop has been deprecated for years and the transition to PSR-11 is long established, updating the type hint to Psr\Container\ContainerInterface in this module would be a good step forward for compatibility with modern Laminas versions.

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

Metadata

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