Skip to content

Commit d0278a6

Browse files
committed
psalm databags
1 parent 38de448 commit d0278a6

File tree

9 files changed

+22
-5
lines changed

9 files changed

+22
-5
lines changed

src/Databags/DatabaseInfo.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Stores relevant information of a database.
2020
*
2121
* @psalm-immutable
22+
*
23+
* @extends AbstractCypherObject<string, mixed>
2224
*/
2325
final class DatabaseInfo extends AbstractCypherObject
2426
{

src/Databags/Neo4jError.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ public function __construct(
3838
*/
3939
public static function fromBoltResponse(Response $response): self
4040
{
41-
/** @var array{code: string, message:string} $content */
41+
/**
42+
* @psalm-suppress ImpurePropertyFetch
43+
* @var array{code: string, message:string} $content
44+
*/
4245
$content = $response->content;
4346

4447
return self::fromMessageAndCode($content['code'], $content['message']);

src/Databags/Plan.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* @see https://neo4j.com/docs/cypher-manual/current/execution-plans/
2424
*
2525
* @psalm-immutable
26+
*
27+
* @extends AbstractCypherObject<string, mixed>
2628
*/
2729
final class Plan extends AbstractCypherObject
2830
{

src/Databags/ProfiledPlan.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
/**
2020
* A plan that has been executed. This means a lot more information is available.
2121
*
22-
* @see \Laudis\Neo4j\Databags\Plan
22+
* @see Plan
2323
*
2424
* @psalm-immutable
25+
*
26+
* @extends AbstractCypherObject<string, mixed>
2527
*/
2628
final class ProfiledPlan extends AbstractCypherObject
2729
{

src/Databags/ResultSummary.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* - information about connection environment
2929
*
3030
* @psalm-immutable
31+
*
32+
* @extends AbstractCypherObject<string, mixed>
3133
*/
3234
final class ResultSummary extends AbstractCypherObject
3335
{

src/Databags/ServerInfo.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Provides some basic information of the server where the result is obtained from.
2222
*
2323
* @psalm-immutable
24+
*
25+
* @extends AbstractCypherObject<string, mixed>
2426
*/
2527
final class ServerInfo extends AbstractCypherObject
2628
{

src/Databags/Statement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* @todo deprecate and create Query Object
2222
*
2323
* @psalm-immutable
24+
*
25+
* @extends AbstractCypherObject<string, mixed>
2426
*/
2527
final class Statement extends AbstractCypherObject
2628
{

src/Databags/SummaryCounters.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Contains counters for various operations that a query triggered.
2020
*
2121
* @psalm-immutable
22+
*
23+
* @extends AbstractCypherObject<string, int|bool>
2224
*/
2325
final class SummaryCounters extends AbstractCypherObject
2426
{
@@ -40,7 +42,7 @@ public function __construct(
4042
) {}
4143

4244
/**
43-
* Whether or not the query contained any updates.
45+
* Whether the query contained any updates.
4446
*/
4547
public function containsUpdates(): bool
4648
{

src/Databags/TransactionConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ public function merge(?TransactionConfiguration $config): self
9999
$config ??= self::default();
100100

101101
$metaData = $config->metaData;
102-
if ($metaData) {
102+
if ($metaData !== null) {
103103
$tsxConfig = $tsxConfig->withMetaData($metaData);
104104
}
105105
$timeout = $config->timeout;
106-
if ($timeout) {
106+
if ($timeout !== null) {
107107
$tsxConfig = $tsxConfig->withTimeout($timeout);
108108
}
109109

0 commit comments

Comments
 (0)