Skip to content

Commit cf090d3

Browse files
committed
static analysis
1 parent 1624dc3 commit cf090d3

File tree

6 files changed

+35
-9
lines changed

6 files changed

+35
-9
lines changed

src/Authentication/BasicAuth.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ public function authenticateHttp(RequestInterface $request, UriInterface $uri, s
5757
}
5858

5959
/**
60-
* @return array{server: string, connection_id: string, hints: array}
6160
* @throws Exception
61+
*
62+
* @return array{server: string, connection_id: string, hints: list}
6263
*/
6364
public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $userAgent): array
6465
{
@@ -71,6 +72,8 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
7172
'credentials' => $this->password,
7273
]);
7374
ResponseHelper::getResponse($protocol);
75+
76+
/** @var array{server: string, connection_id: string, hints: list} */
7477
return $response->content;
7578
} else {
7679
$protocol->hello([
@@ -79,6 +82,8 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
7982
'principal' => $this->username,
8083
'credentials' => $this->password,
8184
]);
85+
86+
/** @var array{server: string, connection_id: string, hints: list} */
8287
return ResponseHelper::getResponse($protocol)->content;
8388
}
8489
}

src/Authentication/KerberosAuth.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
use Bolt\protocol\V5_2;
2020
use Bolt\protocol\V5_3;
2121
use Bolt\protocol\V5_4;
22+
use Exception;
2223
use Laudis\Neo4j\Common\ResponseHelper;
2324
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2425
use Psr\Http\Message\RequestInterface;
2526
use Psr\Http\Message\UriInterface;
26-
use Exception;
2727

2828
use function sprintf;
2929

@@ -54,8 +54,9 @@ public function authenticateHttp(RequestInterface $request, UriInterface $uri, s
5454
}
5555

5656
/**
57-
* @return array{server: string, connection_id: string, hints: array}
5857
* @throws Exception
58+
*
59+
* @return array{server: string, connection_id: string, hints: list}
5960
*/
6061
public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $userAgent): array
6162
{
@@ -68,6 +69,8 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
6869
'credentials' => $this->token,
6970
]);
7071
ResponseHelper::getResponse($protocol);
72+
73+
/** @var array{server: string, connection_id: string, hints: list} */
7174
return $response->content;
7275
} else {
7376
$protocol->hello([
@@ -76,6 +79,8 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
7679
'principal' => '',
7780
'credentials' => $this->token,
7881
]);
82+
83+
/** @var array{server: string, connection_id: string, hints: list} */
7984
return ResponseHelper::getResponse($protocol)->content;
8085
}
8186
}

src/Authentication/NoAuth.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
use Bolt\protocol\V5_2;
2020
use Bolt\protocol\V5_3;
2121
use Bolt\protocol\V5_4;
22+
use Exception;
2223
use Laudis\Neo4j\Common\ResponseHelper;
2324
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2425
use Psr\Http\Message\RequestInterface;
2526
use Psr\Http\Message\UriInterface;
26-
use Exception;
2727

2828
use function sprintf;
2929

@@ -46,8 +46,9 @@ public function authenticateHttp(RequestInterface $request, UriInterface $uri, s
4646
}
4747

4848
/**
49-
* @return array{server: string, connection_id: string, hints: array}
5049
* @throws Exception
50+
*
51+
* @return array{server: string, connection_id: string, hints: list}
5152
*/
5253
public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $userAgent): array
5354
{
@@ -58,12 +59,16 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
5859
'scheme' => 'none',
5960
]);
6061
ResponseHelper::getResponse($protocol);
62+
63+
/** @var array{server: string, connection_id: string, hints: list} */
6164
return $response->content;
6265
} else {
6366
$protocol->hello([
6467
'user_agent' => $userAgent,
6568
'scheme' => 'none',
6669
]);
70+
71+
/** @var array{server: string, connection_id: string, hints: list} */
6772
return ResponseHelper::getResponse($protocol)->content;
6873
}
6974
}

src/Authentication/OpenIDConnectAuth.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
use Bolt\protocol\V5_2;
2020
use Bolt\protocol\V5_3;
2121
use Bolt\protocol\V5_4;
22+
use Exception;
2223
use Laudis\Neo4j\Common\ResponseHelper;
2324
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2425
use Psr\Http\Message\RequestInterface;
2526
use Psr\Http\Message\UriInterface;
26-
use Exception;
2727

2828
use function sprintf;
2929

@@ -51,8 +51,9 @@ public function authenticateHttp(RequestInterface $request, UriInterface $uri, s
5151
}
5252

5353
/**
54-
* @return array{server: string, connection_id: string, hints: array}
5554
* @throws Exception
55+
*
56+
* @return array{server: string, connection_id: string, hints: list}
5657
*/
5758
public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $userAgent): array
5859
{
@@ -64,13 +65,17 @@ public function authenticateBolt(V4_4|V5|V5_1|V5_2|V5_3|V5_4 $protocol, string $
6465
'credentials' => $this->token,
6566
]);
6667
ResponseHelper::getResponse($protocol);
68+
69+
/** @var array{server: string, connection_id: string, hints: list} */
6770
return $response->content;
6871
} else {
6972
$protocol->hello([
7073
'user_agent' => $userAgent,
7174
'scheme' => 'bearer',
7275
'credentials' => $this->token,
7376
]);
77+
78+
/** @var array{server: string, connection_id: string, hints: list} */
7479
return ResponseHelper::getResponse($protocol)->content;
7580
}
7681
}

src/Bolt/BoltConnection.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
use Bolt\enum\ServerState;
1717
use Bolt\enum\Signature;
1818
use Bolt\protocol\Response;
19-
use Bolt\protocol\{V4_4, V5, V5_3, V5_4};
19+
use Bolt\protocol\V4_4;
20+
use Bolt\protocol\V5;
21+
use Bolt\protocol\V5_3;
22+
use Bolt\protocol\V5_4;
2023
use Laudis\Neo4j\Common\ConnectionConfiguration;
2124
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2225
use Laudis\Neo4j\Contracts\ConnectionInterface;

src/Bolt/ProtocolFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515

1616
use Bolt\Bolt;
1717
use Bolt\connection\IConnection;
18-
use Bolt\protocol\{V4_4, V5, V5_3, V5_4};
18+
use Bolt\protocol\V4_4;
19+
use Bolt\protocol\V5;
20+
use Bolt\protocol\V5_3;
21+
use Bolt\protocol\V5_4;
1922
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2023
use RuntimeException;
2124

0 commit comments

Comments
 (0)