Skip to content

Commit

Permalink
Fixed DbalParams and immutable dates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCelavi committed Aug 15, 2024
1 parent 53bd68c commit 3dcb139
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)and this pr

## Changelog

## [8.0.2] - 2024-08-15

### Fixed

- Fixed setting immutable date params with mutable date in
`RunOpenCode\Bundle\QueryResourcesLoader\Executor\Dbal\DbalParameters`.

## [8.0.1] - 2024-08-15

### Fixed

- Fixed nullability of array parameters of `RunOpenCode\Bundle\QueryResourcesLoader\Executor\Dbal\DbalParameters`.
- Fixed nullability of array parameters of `RunOpenCode\Bundle\QueryResourcesLoader\Executor\Dbal\DbalParameters`.

## [8.0.0] - 2024-08-14

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final public function date(string $name, ?\DateTimeInterface $value): self

final public function dateImmutable(string $name, ?\DateTimeInterface $value): self
{
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : null;
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : $value;

return $this->set($name, $value, Types::DATE_IMMUTABLE);
}
Expand All @@ -92,7 +92,7 @@ final public function dateTime(string $name, ?\DateTimeInterface $value): self

final public function dateTimeImmutable(string $name, ?\DateTimeInterface $value): self
{
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : null;
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : $value;

return $this->set($name, $value, Types::DATETIME_IMMUTABLE);
}
Expand All @@ -104,7 +104,7 @@ final public function dateTimeTz(string $name, ?\DateTimeInterface $value): self

final public function dateTimeTzImmutable(string $name, ?\DateTimeInterface $value): self
{
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : null;
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : $value;

return $this->set($name, $value, Types::DATETIMETZ_IMMUTABLE);
}
Expand Down Expand Up @@ -171,7 +171,7 @@ final public function time(string $name, ?\DateTimeInterface $value): self

final public function timeImmutable(string $name, ?\DateTimeInterface $value): self
{
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : null;
$value = null !== $value && !$value instanceof \DateTimeImmutable ? \DateTimeImmutable::createFromInterface($value) : $value;

return $this->set($name, $value, Types::TIME_IMMUTABLE);
}
Expand Down

0 comments on commit 3dcb139

Please sign in to comment.