|
35 | 35 | *
|
36 | 36 | * @implements DriverInterface<T>
|
37 | 37 | *
|
38 |
| - * @psalm-type DiscoveryResult = array{ |
39 |
| - * bolt_routing:string, |
40 |
| - * transaction: string, |
41 |
| - * bolt_direct: string, |
42 |
| - * neo4j_version: string, |
43 |
| - * neo4j_edition: string, |
44 |
| - * db/cluster?: string, |
45 |
| - * dbms/cluster?: string, |
46 |
| - * data?: string |
47 |
| - * } |
48 |
| - * @psalm-type DiscoveryResultLegacy = array{ |
49 |
| - * extensions: array, |
50 |
| - * node: string, |
51 |
| - * relationship: string, |
52 |
| - * node_index: string, |
53 |
| - * relationship_index: string, |
54 |
| - * extensions_info: string, |
55 |
| - * relationship_types: string, |
56 |
| - * batch: string, |
57 |
| - * cypher: string, |
58 |
| - * indexed: string, |
59 |
| - * constraints: string, |
60 |
| - * transaction: string, |
61 |
| - * node_labels: string, |
62 |
| - * neo4j_version: string |
63 |
| - * } |
64 |
| - * |
65 | 38 | * @psalm-import-type OGMResults from \Laudis\Neo4j\Formatter\OGMFormatter
|
66 | 39 | */
|
67 | 40 | final class HttpDriver implements DriverInterface
|
@@ -153,15 +126,17 @@ public function createSession(?SessionConfiguration $config = null): SessionInte
|
153 | 126 | $response = $client->sendRequest($request);
|
154 | 127 |
|
155 | 128 | $discovery = HttpHelper::interpretResponse($response);
|
| 129 | + /** @var string|null */ |
156 | 130 | $version = $discovery->neo4j_version;
|
157 | 131 |
|
158 | 132 | if ($version === null) {
|
159 |
| - /** @psalm-suppress PossiblyUndefinedArrayOffset */ |
160 |
| - $request = $request->withUri(Uri::create($discovery->data)); |
161 |
| - /** @var DiscoveryResultLegacy|DiscoveryResult */ |
| 133 | + /** @var string */ |
| 134 | + $uri = $discovery->data; |
| 135 | + $request = $request->withUri(Uri::create($uri)); |
162 | 136 | $discovery = HttpHelper::interpretResponse($client->sendRequest($request));
|
163 | 137 | }
|
164 | 138 |
|
| 139 | + /** @var string */ |
165 | 140 | $tsx = $discovery->transaction;
|
166 | 141 |
|
167 | 142 | return str_replace('{databaseName}', $database, $tsx);
|
|
0 commit comments