4
4
5
5
namespace Neo4j \Neo4jBundle ;
6
6
7
- use InvalidArgumentException ;
8
7
use Laudis \Neo4j \Authentication \Authenticate ;
9
8
use Laudis \Neo4j \ClientBuilder ;
10
9
use Laudis \Neo4j \Common \Uri ;
13
12
use Laudis \Neo4j \Databags \HttpPsrBindings ;
14
13
use Laudis \Neo4j \Databags \SessionConfiguration ;
15
14
use Laudis \Neo4j \Databags \SslConfiguration ;
15
+ use Laudis \Neo4j \Databags \SummarizedResult ;
16
16
use Laudis \Neo4j \Databags \TransactionConfiguration ;
17
17
use Laudis \Neo4j \Enum \AccessMode ;
18
18
use Laudis \Neo4j \Enum \SslMode ;
19
+ use Laudis \Neo4j \Types \CypherMap ;
19
20
use Neo4j \Neo4jBundle \DependencyInjection \Configuration ;
20
21
use Psr \Http \Client \ClientInterface ;
21
22
use Psr \Http \Message \RequestFactoryInterface ;
@@ -46,10 +47,12 @@ public function __construct(
46
47
private ClientInterface |null $ client ,
47
48
private StreamFactoryInterface |null $ streamFactory ,
48
49
private RequestFactoryInterface |null $ requestFactory ,
49
- ) {}
50
+ ) {
51
+ }
50
52
51
53
public function create (): SymfonyClient
52
54
{
55
+ /** @var ClientBuilder<SummarizedResult<CypherMap>> $builder */
53
56
$ builder = ClientBuilder::create ();
54
57
55
58
if ($ this ->driverConfig ) {
@@ -73,7 +76,6 @@ public function create(): SymfonyClient
73
76
);
74
77
}
75
78
76
- /** @psalm-suppress InvalidArgument */
77
79
return new SymfonyClient ($ builder ->build (), $ this ->eventHandler );
78
80
}
79
81
@@ -129,19 +131,19 @@ private function makeTransactionConfig(): TransactionConfiguration
129
131
*/
130
132
private function createAuth (array |null $ auth , string $ dsn ): AuthenticateInterface
131
133
{
132
- if ($ auth === null ) {
134
+ if (null === $ auth ) {
133
135
return Authenticate::disabled ();
134
136
}
135
137
136
138
return match ($ auth ['type ' ] ?? null ) {
137
139
'basic ' => Authenticate::basic (
138
- $ auth ['username ' ] ?? throw new InvalidArgumentException ('Missing username for basic authentication ' ),
139
- $ auth ['password ' ] ?? throw new InvalidArgumentException ('Missing password for basic authentication ' )
140
+ $ auth ['username ' ] ?? throw new \ InvalidArgumentException ('Missing username for basic authentication ' ),
141
+ $ auth ['password ' ] ?? throw new \ InvalidArgumentException ('Missing password for basic authentication ' )
140
142
),
141
- 'kerberos ' => Authenticate::kerberos ($ auth ['token ' ] ?? throw new InvalidArgumentException ('Missing token for kerberos authentication ' )),
143
+ 'kerberos ' => Authenticate::kerberos ($ auth ['token ' ] ?? throw new \ InvalidArgumentException ('Missing token for kerberos authentication ' )),
142
144
'dsn ' , null => Authenticate::fromUrl (Uri::create ($ dsn )),
143
145
'none ' => Authenticate::disabled (),
144
- 'oid ' => Authenticate::oidc ($ auth ['token ' ] ?? throw new InvalidArgumentException ('Missing token for oid authentication ' )),
146
+ 'oid ' => Authenticate::oidc ($ auth ['token ' ] ?? throw new \ InvalidArgumentException ('Missing token for oid authentication ' )),
145
147
};
146
148
}
147
149
@@ -150,7 +152,7 @@ private function createAuth(array|null $auth, string $dsn): AuthenticateInterfac
150
152
*/
151
153
private function makeSslConfig (array |null $ ssl ): SslConfiguration
152
154
{
153
- if ($ ssl === null ) {
155
+ if (null === $ ssl ) {
154
156
return new SslConfiguration (
155
157
mode: SslMode::DISABLE (),
156
158
verifyPeer: false ,
0 commit comments