Skip to content

Commit 6a8a9a2

Browse files
committed
made parameter type hinting more flexible
1 parent 2e7c98e commit 6a8a9a2

File tree

9 files changed

+18
-14
lines changed

9 files changed

+18
-14
lines changed

src/Basic/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function runStatement(Statement $statement, ?TransactionConfiguration $co
5555
}
5656

5757
/**
58-
* @param iterable<string, scalar|iterable|null> $parameters
58+
* @param iterable<string, mixed> $parameters
5959
*
6060
* @return SummarizedResult<CypherMap>
6161
*/

src/Basic/UnmanagedTransaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(UnmanagedTransactionInterface $tsx)
3434
}
3535

3636
/**
37-
* @param iterable<string, scalar|iterable|null> $parameters
37+
* @param iterable<string, mixed> $parameters
3838
*
3939
* @return SummarizedResult<CypherMap>
4040
*/

src/Contracts/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface ClientInterface extends TransactionInterface
2828
/**
2929
* Runs a one off transaction with the provided query and parameters over the connection with the provided alias or the master alias otherwise.
3030
*
31-
* @param iterable<string, scalar|iterable|null> $parameters
31+
* @param iterable<string, mixed> $parameters
3232
*
3333
* @throws Neo4jException
3434
*

src/Contracts/SessionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function runStatements(iterable $statements, ?TransactionConfiguration $c
4343
public function runStatement(Statement $statement, ?TransactionConfiguration $config = null);
4444

4545
/**
46-
* @param iterable<string, scalar|iterable|null> $parameters
46+
* @param iterable<string, mixed> $parameters
4747
*
4848
* @return ResultFormat
4949
*/

src/Contracts/TransactionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
interface TransactionInterface
2828
{
2929
/**
30-
* @param iterable<string, scalar|iterable|null> $parameters
30+
* @param iterable<string, mixed> $parameters
3131
*
3232
* @return ResultFormat
3333
*/

src/Databags/Statement.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
final class Statement extends AbstractCypherObject
2626
{
2727
private string $text;
28-
/** @var iterable<string, scalar|iterable|null> */
28+
/** @var iterable<string, mixed> */
2929
private iterable $parameters;
3030

3131
/**
32-
* @param iterable<string, scalar|iterable|null> $parameters
32+
* @param iterable<string, mixed> $parameters
3333
*/
3434
public function __construct(string $text, iterable $parameters)
3535
{
@@ -40,7 +40,7 @@ public function __construct(string $text, iterable $parameters)
4040
/**
4141
* @pure
4242
*
43-
* @param iterable<string, scalar|iterable|null>|null $parameters
43+
* @param iterable<string, mixed>|null $parameters
4444
*/
4545
public static function create(string $text, ?iterable $parameters = null): Statement
4646
{
@@ -58,7 +58,7 @@ public function getText(): string
5858
/**
5959
* The parameter mapping.
6060
*
61-
* @return iterable<string, scalar|iterable|null>
61+
* @return iterable<string, mixed>
6262
*/
6363
public function getParameters(): iterable
6464
{

src/ParameterHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,18 @@ private static function filledIterableToArray($value): ?array
164164
}
165165

166166
/**
167-
* @param iterable<iterable|scalar|null> $parameters
167+
* @param iterable<mixed> $parameters
168168
*
169169
* @return CypherMap<iterable|scalar|stdClass|null>
170170
*/
171171
public static function formatParameters(iterable $parameters, bool $boltDriver = false): CypherMap
172172
{
173173
/** @var array<string, iterable|scalar|stdClass|null> $tbr */
174174
$tbr = [];
175+
/**
176+
* @var mixed $key
177+
* @var mixed $value
178+
*/
175179
foreach ($parameters as $key => $value) {
176180
if (!(is_int($key) || is_string($key))) {
177181
$msg = 'The parameters must have an integer or string as key values, '.gettype($key).' received.';

src/Types/Time.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(int $nanoSeconds, int $tzOffsetSeconds)
3535
}
3636

3737
/**
38-
* @return array{nanoseconds: int, tzOffsetSeconds: int}
38+
* @return array{nanoSeconds: int, tzOffsetSeconds: int}
3939
*/
4040
public function toArray(): array
4141
{

testkit-backend/src/Requests/SessionRunRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ final class SessionRunRequest
2121
private string $cypher;
2222
/** @var iterable<string, array{name: string, data: array{value: iterable|scalar|null}}> */
2323
private iterable $params;
24-
/** @var iterable<string, scalar|iterable|null>|null */
24+
/** @var iterable<string, mixed>|null */
2525
private ?iterable $txMeta;
2626
private ?int $timeout;
2727

2828
/**
2929
* @param iterable<string, array{name: string, data: array{value: iterable|scalar|null}}>|null $params
30-
* @param iterable<string, scalar|iterable|null>|null $txMeta
30+
* @param iterable<string, mixed>|null $txMeta
3131
*/
3232
public function __construct(Uuid $sessionId, string $cypher, ?iterable $params, ?iterable $txMeta, ?int $timeout)
3333
{
@@ -57,7 +57,7 @@ public function getParams(): iterable
5757
}
5858

5959
/**
60-
* @return iterable<string, scalar|iterable|null>|null
60+
* @return iterable<string, mixed>|null
6161
*/
6262
public function getTxMeta(): ?iterable
6363
{

0 commit comments

Comments
 (0)