Skip to content

Commit

Permalink
Added processing binary binding type and default behaviour for unproc…
Browse files Browse the repository at this point in the history
…essed parameter types
  • Loading branch information
yevheniipererva committed Nov 26, 2024
1 parent 9e10380 commit 05d5144
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Persisters/Entity/BasicEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\Common\Collections\Order;
use Doctrine\DBAL\ArrayParameterType;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
Expand Down Expand Up @@ -1929,7 +1930,11 @@ private function getTypes(string $field, mixed $value, ClassMetadata $class): ar
return $types;
}

/** @psalm-return ArrayParameterType::* */
/** @psalm-return ArrayParameterType::*
*
* @throws QueryException
* @throws Exception
*/
private function getArrayBindingType(ParameterType|int|string $type): ArrayParameterType|int
{
if (! $type instanceof ParameterType) {
Expand All @@ -1940,6 +1945,8 @@ private function getArrayBindingType(ParameterType|int|string $type): ArrayParam
ParameterType::STRING => ArrayParameterType::STRING,
ParameterType::INTEGER => ArrayParameterType::INTEGER,
ParameterType::ASCII => ArrayParameterType::ASCII,
ParameterType::BINARY => ArrayParameterType::BINARY,
default => throw new QueryException('Unsupported type for array parameter'),
};
}

Expand Down

0 comments on commit 05d5144

Please sign in to comment.