Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/Driver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,7 @@ protected function bindParameters(
protected function formatDatetime(\DateTimeInterface $value): string
{
try {
$datetime = match (true) {
$value instanceof \DateTimeImmutable => $value->setTimezone($this->getTimezone()),
$value instanceof \DateTime => \DateTimeImmutable::createFromMutable($value)
->setTimezone($this->getTimezone()),
default => (new \DateTimeImmutable('now', $this->getTimezone()))->setTimestamp($value->getTimestamp()),
};
$datetime = \DateTimeImmutable::createFromInterface($value)->setTimezone($this->getTimezone());
} catch (\Throwable $e) {
throw new DriverException($e->getMessage(), (int) $e->getCode(), $e);
}
Expand Down
7 changes: 1 addition & 6 deletions vendor-bin/psalm/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="7.11.0@9e0d0f88bc0a4233357a9aeb4b32da060644e196">
<files psalm-version="7.13.2@4a0667bf263efe571c414969b09b05a8db87c9f6">
<file src="src/Config/ConnectionConfig.php">
<MixedAssignment>
<code><![CDATA[$options[$key]]]></code>
Expand Down Expand Up @@ -775,7 +775,6 @@
<code><![CDATA[$arguments[1] ?? null]]></code>
<code><![CDATA[$type]]></code>
<code><![CDATA[$value]]></code>
<code><![CDATA[$value->getTimestamp()]]></code>
</MixedArgument>
<MixedAssignment>
<code><![CDATA[$name]]></code>
Expand All @@ -784,9 +783,6 @@
<code><![CDATA[$parameter]]></code>
<code><![CDATA[$type]]></code>
</MixedAssignment>
<MixedMethodCall>
<code><![CDATA[getTimestamp]]></code>
</MixedMethodCall>
<NullableReturnStatement>
<code><![CDATA[$this->pdo]]></code>
</NullableReturnStatement>
Expand All @@ -809,7 +805,6 @@
</TaintedSql>
<TypeDoesNotContainType>
<code><![CDATA[$connection instanceof PDOConnectionConfig]]></code>
<code><![CDATA[(new \DateTimeImmutable('now', $this->getTimezone()))->setTimestamp($value->getTimestamp())]]></code>
</TypeDoesNotContainType>
</file>
<file src="src/Driver/Handler.php">
Expand Down
Loading