You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tying to migrate to DBAL 4 (4.0.1) and in v3 we had Connection::PARAM_INT_ARRAY deprecated in favour of ArrayParameterType::INTEGER.
Then in v4 ArrayParameterType has been changed to enum, so it is a type itself.
Example query we have in the migrations:
$this->addSql('DELETE FROM books WHERE id IN (:ids)', ['ids' => $booksIds], ['ids' => ArrayParameterType::INTEGER]);
Current behavior
Exception:
Fatal error: Uncaught TypeError: Doctrine\Migrations\InlineParameterFormatter::formatParameter(): Argument #2 ($type) must be of type string|int, Doctrine\DBAL\ArrayParameterType given, called in [...]/vendor/doctrine/migrations/lib/Doctrine/Migrations/InlineParameterFormatter.php on line 46 and defined in [...]/vendor/doctrine/migrations/lib/Doctrine/Migrations/InlineParameterFormatter.php on line 56
TypeError: Doctrine\Migrations\InlineParameterFormatter::formatParameter(): Argument #2 ($type) must be of type string|int, Doctrine\DBAL\ArrayParameterType given, called in [...]/vendor/doctrine/migrations/lib/Doctrine/Migrations/InlineParameterFormatter.php on line 46 in [...]/vendor/doctrine/migrations/lib/Doctrine/Migrations/InlineParameterFormatter.php on line 56
Fixesdoctrine#1407
A bit lame fix, but it looks like we did not really use other int types before anyway
With this change we can use DBAL v4 new enum types: `ArrayParameterType` and `ParameterType`.
Bumping version of DBAL to 3.6 as before that `ArrayParameterType` did not exist.
)
Fixes#1407
A bit lame fix, but it looks like we did not really use other int types before anyway
With this change we can use DBAL v4 new enum types: `ArrayParameterType` and `ParameterType`.
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Bug Report
Summary
Tying to migrate to DBAL 4 (4.0.1) and in v3 we had
Connection::PARAM_INT_ARRAY
deprecated in favour ofArrayParameterType::INTEGER
.Then in v4
ArrayParameterType
has been changed to enum, so it is a type itself.Example query we have in the migrations:
Current behavior
Exception:
How to reproduce
As I see the typehint here:
https://github.com/doctrine/migrations/blob/3.7.x/lib/Doctrine/Migrations/InlineParameterFormatter.php#L56
is just
string|int $type
, so it would not work with DBAL 4.0It is kinda similar to: doctrine/dbal#6309
Expected behavior
No errors.
The text was updated successfully, but these errors were encountered: