diff --git a/analyzer-baseline.toml b/analyzer-baseline.toml index 22faabb6..8b23a15d 100644 --- a/analyzer-baseline.toml +++ b/analyzer-baseline.toml @@ -416,20 +416,14 @@ count = 1 [[issues]] file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "missing-api-or-internal" -message = 'Abstract class `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection` is missing an `@api` or `@internal` annotation.' -count = 1 - -[[issues]] -file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\Adapter\Driver\DriverInterface::createResult`: expected `resource`, but found `mixed`.' +code = "invalid-argument" +message = 'Invalid argument type for argument #1 of `PhpDb\Adapter\Driver\DriverInterface::createResult`: expected `resource`, but found `PDOStatement`.' count = 1 [[issues]] file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\Adapter\Exception\InvalidQueryException::forDriverError`: expected `string`, but found `mixed`.' +code = "missing-api-or-internal" +message = 'Abstract class `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection` is missing an `@api` or `@internal` annotation.' count = 1 [[issues]] @@ -438,30 +432,6 @@ code = "mixed-argument" message = "Invalid argument type for argument #1 of `strtolower`: expected `string`, but found `mixed`." count = 1 -[[issues]] -file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-array-access" -message = "Unsafe array access on type `mixed`." -count = 1 - -[[issues]] -file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-assignment" -message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 2 - -[[issues]] -file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection::execute`. Saw type `mixed`.' -count = 1 - -[[issues]] -file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\Adapter\Driver\Pdo\AbstractPdoConnection::prepare`. Saw type `mixed`.' -count = 1 - [[issues]] file = "src/Adapter/Driver/Pdo/AbstractPdoConnection.php" code = "possible-method-access-on-null" @@ -1446,12 +1416,6 @@ code = "incompatible-return-type" message = 'Return type `int|null` of `PhpDb\ResultSet\AbstractResultSet::count()` is incompatible with parent return type `int` of `Countable::count()`' count = 1 -[[issues]] -file = "src/ResultSet/AbstractResultSet.php" -code = "invalid-return-statement" -message = 'Invalid return type for function `PhpDb\ResultSet\AbstractResultSet::resolveIterator`: expected `Iterator`, but found `DOMNodeList|DatePeriod|Ds\Collection|Generator|Iterator|PDOStatement`.' -count = 1 - [[issues]] file = "src/ResultSet/AbstractResultSet.php" code = "invalid-type-cast" @@ -1584,47 +1548,17 @@ code = "mixed-argument" message = 'Invalid argument type for argument #1 of `PhpDb\RowGateway\Exception\RuntimeException::forMissingPrimaryKeyData`: expected `string`, but found `mixed`.' count = 1 -[[issues]] -file = "src/RowGateway/AbstractRowGateway.php" -code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\Sql\Sql::prepareStatementForSqlObject`: expected `PhpDb\Sql\PreparableSqlInterface`, but found `mixed`.' -count = 4 - [[issues]] file = "src/RowGateway/AbstractRowGateway.php" code = "mixed-assignment" message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 19 - -[[issues]] -file = "src/RowGateway/AbstractRowGateway.php" -code = "mixed-method-access" -message = "Attempting to access a method on a non-object type (`mixed`)." -count = 14 - -[[issues]] -file = "src/RowGateway/AbstractRowGateway.php" -code = "mixed-operand" -message = "Left operand in `&&` operation has `mixed` type." -count = 1 - -[[issues]] -file = "src/RowGateway/AbstractRowGateway.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\RowGateway\AbstractRowGateway::delete`. Saw type `mixed`.' -count = 1 - -[[issues]] -file = "src/RowGateway/AbstractRowGateway.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\RowGateway\AbstractRowGateway::save`. Saw type `mixed`.' -count = 1 +count = 6 [[issues]] file = "src/RowGateway/AbstractRowGateway.php" code = "possible-method-access-on-null" message = "Attempting to call a method on `null`." -count = 10 +count = 15 [[issues]] file = "src/RowGateway/AbstractRowGateway.php" @@ -1980,36 +1914,6 @@ code = "invalid-return-statement" message = 'Invalid return type for function `PhpDb\Sql\Ddl\AlterTable::processTable`: expected `array`, but found `list{array|null|string}`.' count = 1 -[[issues]] -file = "src/Sql/Ddl/AlterTable.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{list}` is less specific than the declared return type `array{0: list}` for function `PhpDb\Sql\Ddl\AlterTable::processChangeColumns` due to nested 'mixed'.''' -count = 1 - -[[issues]] -file = "src/Sql/Ddl/AlterTable.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{list}` is less specific than the declared return type `array{0: list}` for function `PhpDb\Sql\Ddl\AlterTable::processDropColumns` due to nested 'mixed'.''' -count = 1 - -[[issues]] -file = "src/Sql/Ddl/AlterTable.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{list}` is less specific than the declared return type `array{0: list}` for function `PhpDb\Sql\Ddl\AlterTable::processDropConstraints` due to nested 'mixed'.''' -count = 1 - -[[issues]] -file = "src/Sql/Ddl/AlterTable.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{list}` is less specific than the declared return type `array{0: list}` for function `PhpDb\Sql\Ddl\AlterTable::processDropIndexes` due to nested 'mixed'.''' -count = 1 - -[[issues]] -file = "src/Sql/Ddl/AlterTable.php" -code = "mixed-assignment" -message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 1 - [[issues]] file = "src/Sql/Ddl/AlterTable.php" code = "possible-method-access-on-null" @@ -2250,12 +2154,6 @@ code = "invalid-return-statement" message = '''Invalid return type for function `PhpDb\Sql\Ddl\CreateTable::processTable`: expected `array`, but found `list{string('')|string('TEMPORARY '), string('')|string('IF NOT EXISTS '), array|null|string}`.''' count = 1 -[[issues]] -file = "src/Sql/Ddl/CreateTable.php" -code = "mixed-assignment" -message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 1 - [[issues]] file = "src/Sql/Ddl/CreateTable.php" code = "possible-method-access-on-null" @@ -2460,12 +2358,6 @@ code = "less-specific-argument" message = 'Argument type mismatch for argument #1 of `PhpDb\Adapter\Platform\PlatformInterface::quoteIdentifier`: expected `string`, but provided type `array-key` is less specific.' count = 1 -[[issues]] -file = "src/Sql/Insert.php" -code = "less-specific-nested-argument-type" -message = "Argument type mismatch for argument #2 of `implode`: expected `array|null`, but provided type `list` is less specific." -count = 1 - [[issues]] file = "src/Sql/Insert.php" code = "missing-return-type" @@ -2808,12 +2700,6 @@ code = "missing-api-or-internal" message = 'Interface `PhpDb\Sql\Predicate\PredicateInterface` is missing an `@api` or `@internal` annotation.' count = 1 -[[issues]] -file = "src/Sql/Predicate/PredicateSet.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `array{'spec': non-empty-string, 'values': mixed}` is less specific than the declared return type `array{'spec': string, 'values': list}` for function `PhpDb\Sql\Predicate\PredicateSet::getExpressionData` due to nested 'mixed'.''' -count = 1 - [[issues]] file = "src/Sql/Predicate/PredicateSet.php" code = "mixed-argument" @@ -2844,22 +2730,10 @@ code = "mixed-argument" message = 'Invalid argument type for argument #3 of `PhpDb\Sql\Predicate\Operator::__construct`: expected `PhpDb\Sql\ArgumentInterface|PhpDb\Sql\ExpressionInterface|PhpDb\Sql\SqlInterface|null|scalar`, but found `nonnull`.' count = 1 -[[issues]] -file = "src/Sql/Predicate/PredicateSet.php" -code = "mixed-array-access" -message = "Unsafe array access on type `mixed`." -count = 2 - [[issues]] file = "src/Sql/Predicate/PredicateSet.php" code = "mixed-assignment" message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 2 - -[[issues]] -file = "src/Sql/Predicate/PredicateSet.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\Sql\Predicate\PredicateSet::getExpressionData`. Saw type `mixed`.' count = 1 [[issues]] @@ -2946,18 +2820,6 @@ code = "invalid-return-statement" message = '''Invalid return type for function `PhpDb\Sql\Select::resolveTable`: expected `array{0: null|string, 1: string}`, but found `list{array|null|string, string('')|truthy-string}`.''' count = 1 -[[issues]] -file = "src/Sql/Select.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{mixed}` is less specific than the declared return type `array{0: string}|null` for function `PhpDb\Sql\Select::processLimit` due to nested 'mixed'.''' -count = 1 - -[[issues]] -file = "src/Sql/Select.php" -code = "less-specific-nested-return-statement" -message = '''Returned type `list{mixed}` is less specific than the declared return type `array{0: string}|null` for function `PhpDb\Sql\Select::processOffset` due to nested 'mixed'.''' -count = 1 - [[issues]] file = "src/Sql/Select.php" code = "missing-return-type" @@ -3369,19 +3231,19 @@ count = 1 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "less-specific-nested-argument-type" -message = 'Argument type mismatch for argument #1 of `PhpDb\Sql\Select::columns`: expected `array`, but provided type `non-empty-array` is less specific.' +message = 'Argument type mismatch for argument #1 of `PhpDb\ResultSet\ResultSetInterface::initialize`: expected `iterable`, but provided type `PhpDb\Adapter\Driver\ResultInterface|null` is less specific.' count = 1 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" -code = "missing-api-or-internal" -message = 'Abstract class `PhpDb\TableGateway\AbstractTableGateway` is missing an `@api` or `@internal` annotation.' +code = "less-specific-nested-argument-type" +message = 'Argument type mismatch for argument #1 of `PhpDb\Sql\Select::columns`: expected `array`, but provided type `non-empty-array` is less specific.' count = 1 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\ResultSet\ResultSetInterface::initialize`: expected `iterable`, but found `mixed`.' +code = "missing-api-or-internal" +message = 'Abstract class `PhpDb\TableGateway\AbstractTableGateway` is missing an `@api` or `@internal` annotation.' count = 1 [[issues]] @@ -3399,31 +3261,25 @@ count = 2 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\Sql\Update::table`: expected `PhpDb\Sql\TableIdentifier|array|string`, but found `mixed`.' -count = 2 - -[[issues]] -file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\TableGateway\AbstractTableGateway::executeDelete`: expected `PhpDb\Sql\Delete`, but found `mixed`.' +message = 'Invalid argument type for argument #1 of `PhpDb\Sql\Update::join`: expected `PhpDb\Sql\TableIdentifier|non-empty-array|string`, but found `mixed`.' count = 1 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\TableGateway\AbstractTableGateway::executeInsert`: expected `PhpDb\Sql\Insert`, but found `mixed`.' -count = 1 +message = 'Invalid argument type for argument #1 of `PhpDb\Sql\Update::table`: expected `PhpDb\Sql\TableIdentifier|array|string`, but found `mixed`.' +count = 2 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\TableGateway\AbstractTableGateway::executeUpdate`: expected `PhpDb\Sql\Update`, but found `mixed`.' +message = 'Invalid argument type for argument #2 of `PhpDb\Sql\Update::join`: expected `string`, but found `mixed`.' count = 1 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "mixed-argument" -message = 'Invalid argument type for argument #1 of `PhpDb\TableGateway\AbstractTableGateway::selectWith`: expected `PhpDb\Sql\Select`, but found `mixed`.' +message = 'Invalid argument type for argument #3 of `PhpDb\Sql\Update::join`: expected `string`, but found `nonnull`.' count = 1 [[issues]] @@ -3436,7 +3292,7 @@ count = 6 file = "src/TableGateway/AbstractTableGateway.php" code = "mixed-assignment" message = "Assigning `mixed` type to a variable may lead to unexpected behavior." -count = 21 +count = 9 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" @@ -3450,30 +3306,6 @@ code = "mixed-clone" message = "Cannot statically verify `clone` on a `mixed` type." count = 1 -[[issues]] -file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-method-access" -message = "Attempting to access a method on a non-object type (`mixed`)." -count = 13 - -[[issues]] -file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\TableGateway\AbstractTableGateway::executeDelete`. Saw type `mixed`.' -count = 1 - -[[issues]] -file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\TableGateway\AbstractTableGateway::executeInsert`. Saw type `mixed`.' -count = 1 - -[[issues]] -file = "src/TableGateway/AbstractTableGateway.php" -code = "mixed-return-statement" -message = 'Could not infer a precise return type for function `PhpDb\TableGateway\AbstractTableGateway::executeUpdate`. Saw type `mixed`.' -count = 1 - [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "nullable-return-statement" @@ -3514,7 +3346,7 @@ count = 1 file = "src/TableGateway/AbstractTableGateway.php" code = "possible-method-access-on-null" message = "Attempting to call a method on `null`." -count = 25 +count = 28 [[issues]] file = "src/TableGateway/AbstractTableGateway.php" @@ -3528,6 +3360,12 @@ code = "possibly-invalid-clone" message = 'Expression of type `PhpDb\Sql\Sql|null` might not be a cloneable object.' count = 1 +[[issues]] +file = "src/TableGateway/AbstractTableGateway.php" +code = "possibly-null-argument" +message = 'Argument #1 of method `PhpDb\ResultSet\ResultSetInterface::initialize` is possibly `null`, but parameter type `iterable` does not accept it.' +count = 1 + [[issues]] file = "src/TableGateway/AbstractTableGateway.php" code = "possibly-undefined-string-array-index" @@ -3552,6 +3390,12 @@ code = "class-must-be-final" message = 'Class `PhpDb\TableGateway\Exception\RuntimeException` should be declared `final`.' count = 1 +[[issues]] +file = "src/TableGateway/Feature/EventFeature/TableGatewayEvent.php" +code = "imprecise-type" +message = "Type `array` in return type of `getParams` is imprecise, equivalent to `array`." +count = 1 + [[issues]] file = "src/TableGateway/Feature/MetadataFeature.php" code = "mixed-assignment"