Skip to content

Commit d557e05

Browse files
committed
tested connection factory
1 parent 573cf47 commit d557e05

17 files changed

+135
-47
lines changed

src/Authentication/NoAuth.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Laudis\Neo4j\Contracts\AuthenticateInterface;
1919
use Psr\Http\Message\RequestInterface;
2020
use Psr\Http\Message\UriInterface;
21-
2221
use function sprintf;
2322

2423
/**

src/Authentication/OpenIDConnectAuth.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Laudis\Neo4j\Contracts\AuthenticateInterface;
1717
use Psr\Http\Message\RequestInterface;
1818
use Psr\Http\Message\UriInterface;
19-
2019
use function sprintf;
2120

2221
final class OpenIDConnectAuth implements AuthenticateInterface

src/Bolt/BoltConnection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace Laudis\Neo4j\Bolt;
1515

16-
use Bolt\connection\IConnection;
1716
use Bolt\error\IgnoredException;
1817
use Bolt\error\MessageException;
1918
use Bolt\protocol\V3;

src/Bolt/BoltDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
namespace Laudis\Neo4j\Bolt;
1515

1616
use Exception;
17-
use Laudis\Neo4j\Common\SingleThreadedSemaphore;
18-
use Laudis\Neo4j\Common\SysVSemaphore;
1917
use function extension_loaded;
2018
use function is_string;
2119
use Laudis\Neo4j\Authentication\Authenticate;
20+
use Laudis\Neo4j\Common\SingleThreadedSemaphore;
21+
use Laudis\Neo4j\Common\SysVSemaphore;
2222
use Laudis\Neo4j\Common\Uri;
2323
use Laudis\Neo4j\Contracts\AuthenticateInterface;
2424
use Laudis\Neo4j\Contracts\DriverInterface;

src/Bolt/ProtocolFactory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
class ProtocolFactory
2424
{
2525
/**
26-
* @param IConnection $connection
27-
* @param AuthenticateInterface $auth
28-
* @param string $userAgent
29-
*
3026
* @return array{0: V3, 1: array{server: string, connection_id: string, hints: list}}
3127
*/
3228
public function createProtocol(IConnection $connection, AuthenticateInterface $auth, string $userAgent): array

src/Bolt/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class Session implements SessionInterface
6464
private BookmarkHolder $bookmarkHolder;
6565

6666
/**
67-
* @param FormatterInterface<ResultFormat> $formatter
67+
* @param FormatterInterface<ResultFormat> $formatter
6868
* @param ConnectionPool|Neo4jConnectionPool $pool
6969
*
7070
* @psalm-mutation-free

src/Bolt/SocketConnectionFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
namespace Laudis\Neo4j\Bolt;
1515

1616
use Bolt\connection\Socket;
17+
use Laudis\Neo4j\Contracts\BasicConnectionFactoryInterface;
1718

18-
final class SocketConnectionFactory
19+
final class SocketConnectionFactory implements BasicConnectionFactoryInterface
1920
{
2021
private StreamConnectionFactory $factory;
2122

src/Bolt/SslConfigurationFactory.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Neo4j PHP Client and Driver package.
7+
*
8+
* (c) Nagels <https://nagels.tech>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
514
namespace Laudis\Neo4j\Bolt;
615

16+
use function explode;
17+
use const FILTER_VALIDATE_IP;
18+
use function filter_var;
719
use Laudis\Neo4j\Databags\SslConfiguration;
820
use Laudis\Neo4j\Enum\SslMode;
921
use Psr\Http\Message\UriInterface;
1022

11-
use function explode;
12-
use function filter_var;
13-
14-
use const FILTER_VALIDATE_IP;
15-
1623
class SslConfigurationFactory
1724
{
1825
/**
19-
* @param UriInterface $uri
20-
* @param SslConfiguration $config
21-
*
2226
* @return array{0: 's'|'ssc'|'s', 1: array}
2327
*/
2428
public function create(UriInterface $uri, SslConfiguration $config): array
@@ -39,10 +43,10 @@ public function create(UriInterface $uri, SslConfiguration $config): array
3943
return [$sslConfig, $this->enableSsl($uri->getHost(), $sslConfig, $config)];
4044
}
4145

42-
return [$sslConfig, null];
46+
return [$sslConfig, []];
4347
}
4448

45-
private function enableSsl(string $host, string $sslConfig, SslConfiguration $config): ?array
49+
private function enableSsl(string $host, string $sslConfig, SslConfiguration $config): array
4650
{
4751
$options = [
4852
'verify_peer' => $config->isVerifyPeer(),
@@ -61,6 +65,6 @@ private function enableSsl(string $host, string $sslConfig, SslConfiguration $co
6165
return $options;
6266
}
6367

64-
return null;
68+
return [];
6569
}
6670
}

src/Bolt/StreamConnectionFactory.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@
1313

1414
namespace Laudis\Neo4j\Bolt;
1515

16-
use Bolt\connection\IConnection;
1716
use Bolt\connection\StreamSocket;
18-
use function explode;
19-
use const FILTER_VALIDATE_IP;
20-
use function filter_var;
21-
use Laudis\Neo4j\Databags\SslConfiguration;
22-
use Laudis\Neo4j\Enum\SslMode;
23-
use Psr\Http\Message\UriInterface;
17+
use Laudis\Neo4j\Contracts\BasicConnectionFactoryInterface;
2418

25-
final class StreamConnectionFactory
19+
final class StreamConnectionFactory implements BasicConnectionFactoryInterface
2620
{
2721
public function create(UriConfiguration $config): Connection
2822
{

src/Bolt/UriConfiguration.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Neo4j PHP Client and Driver package.
7+
*
8+
* (c) Nagels <https://nagels.tech>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
514
namespace Laudis\Neo4j\Bolt;
615

716
final class UriConfiguration

0 commit comments

Comments
 (0)