Skip to content

Fix record: mixed-* findings in Connection/Pdo/Connection/Ddl decorators stem from untyped upstream array boundaries #65

Description

@tyrsson

Context

Part of #60.

Data

Multiple mixed-argument/mixed-assignment/mixed-array-assignment/less-specific-argument findings trace to untyped array boundaries in upstream php-db/phpdb:

  • AbstractConnection::$connectionParameters (protected array $connectionParameters = [];, no shape) — affects src/Connection.php and src/Pdo/Connection.php.
  • ColumnInterface::getOptions(): array and matching CreateTable::getOptions() / AlterTable::getOptions() (untyped array return) — affects src/Sql/Ddl/AlterTableDecorator.php and src/Sql/Ddl/CreateTableDecorator.php.
  • AlterTable's 7 untyped array properties ($addColumns, $addConstraints, $changeColumns, $dropColumns, $dropConstraints, $dropIndexes, $options) and CreateTable's 4 ($columns, $constraints, $options, $specifications) — all declared protected array $x = []; with no shape docblock. Concretely, this is why foreach ($this->changeColumns as $name => $column) in AlterTableDecorator::processChangeColumns() resolves $name to generic array-key rather than string, producing a less-specific-argument finding at PlatformInterface::quoteIdentifier($name) — left unsuppressed and uncast intentionally, so the baseline entry can be dropped cleanly once the upstream shape lands, without a workaround cast to remove.

Tracked upstream at php-db/phpdb#169.

These findings will be captured in a mago baseline rather than fixed or suppressed inline, pending the upstream fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    Todo
    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions