Skip to content

[Analysis] Container/*Factory.php: mixed-* findings from Laminas ServiceManager's untyped get()/build() returns #74

Description

@tyrsson

Context

Part of #60.

Data

mago analyze flags mixed-assignment/mixed-argument/less-specific-argument/possibly-null-argument across all 8 factories in src/Container/ (MetadataInterfaceFactory, PdoConnectionInterfaceFactory, ConnectionInterfaceFactory, PdoDriverInterfaceFactory, DriverInterfaceFactory, PdoStatementFactory, PlatformInterfaceFactory, StatementInterfaceFactory). Root cause: Psr\Container\ContainerInterface::get() and Laminas\ServiceManager\ServiceManager::build() both return mixed, and the $options arrays passed through are untyped, so every value pulled from the container and passed into a concrete constructor resolves to mixed.

Also 2x missing-constant-type (MetadataInterfaceFactory::ADAPTER_SERVICE_NAME) noted separately in this same sweep, unrelated to the mixed-* cluster.

These findings will be captured in a mago baseline rather than fixed or suppressed inline.

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions