Skip to content

Commit 6de8be4

Browse files
committed
enabled correct conversion of datetime
1 parent c57395e commit 6de8be4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/BoltFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
namespace Laudis\Neo4j;
1515

16-
use Bolt\Bolt;
17-
1816
use function explode;
1917

2018
use Laudis\Neo4j\Bolt\BoltConnection;
@@ -81,7 +79,7 @@ public function createConnection(ConnectionRequestData $data, SessionConfigurati
8179
public function canReuseConnection(ConnectionInterface $connection, ConnectionRequestData $data, SessionConfiguration $config): bool
8280
{
8381
$databaseInfo = $connection->getDatabaseInfo();
84-
$database = $databaseInfo === null ? null : $databaseInfo->getName();
82+
$database = $databaseInfo?->getName();
8583

8684
return $connection->getServerAddress()->getHost() === $data->getUri()->getHost() &&
8785
$connection->getServerAddress()->getPort() === $data->getUri()->getPort() &&

src/Types/DateTime.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ public function getProperties(): CypherMap
113113

114114
public function convertToBolt(): IStructure
115115
{
116-
return new \Bolt\protocol\v1\structures\DateTime($this->getSeconds(), $this->getNanoseconds(), $this->getTimeZoneOffsetSeconds());
116+
if ($this->legacy) {
117+
return new \Bolt\protocol\v1\structures\DateTime($this->getSeconds(), $this->getNanoseconds(), $this->getTimeZoneOffsetSeconds());
118+
}
119+
120+
return new \Bolt\protocol\v5\structures\DateTime($this->getSeconds(), $this->getNanoseconds(), $this->getTimeZoneOffsetSeconds());
117121
}
118122
}

0 commit comments

Comments
 (0)