@@ -27,9 +27,7 @@ public static function connect(ConnectionConfig $connectionConfig, ?Cancellation
2727 throw new \Error ('ext-pgsql is not compatible with pecl-ev; use pecl-pq or a different loop extension ' );
2828 } // @codeCoverageIgnoreEnd
2929
30- $ connectionString = \str_replace ("; " , " " , $ connectionConfig ->getConnectionString ());
31-
32- if (!$ connection = @\pg_connect ($ connectionString , \PGSQL_CONNECT_ASYNC | \PGSQL_CONNECT_FORCE_NEW )) {
30+ if (!$ connection = @\pg_connect ($ connectionConfig ->getConnectionString (), \PGSQL_CONNECT_ASYNC | \PGSQL_CONNECT_FORCE_NEW )) {
3331 return new Failure (new ConnectionException ("Failed to create connection resource " ));
3432 }
3533
@@ -43,13 +41,11 @@ public static function connect(ConnectionConfig $connectionConfig, ?Cancellation
4341
4442 $ deferred = new Deferred ;
4543
46- $ callback = function ($ watcher , $ resource ) use ($ connection , $ deferred ) {
44+ $ callback = function ($ watcher , $ resource ) use ($ connection , $ deferred ): void {
4745 switch (\pg_connect_poll ($ connection )) {
48- case \PGSQL_POLLING_READING :
49- return ; // Connection not ready, poll again.
50-
51- case \PGSQL_POLLING_WRITING :
52- return ; // Still writing...
46+ case \PGSQL_POLLING_READING : // Connection not ready, poll again.
47+ case \PGSQL_POLLING_WRITING : // Still writing...
48+ return ;
5349
5450 case \PGSQL_POLLING_FAILED :
5551 $ deferred ->fail (new ConnectionException (\pg_last_error ($ connection )));
@@ -66,7 +62,7 @@ public static function connect(ConnectionConfig $connectionConfig, ?Cancellation
6662
6763 $ promise = $ deferred ->promise ();
6864
69- $ token = $ token ?? new NullCancellationToken () ;
65+ $ token = $ token ?? new NullCancellationToken ;
7066 $ id = $ token ->subscribe ([$ deferred , "fail " ]);
7167
7268 $ promise ->onResolve (function ($ exception ) use ($ connection , $ poll , $ await , $ id , $ token ): void {
0 commit comments