• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prooph / event-store-client / 9555551525

17 Jun 2024 10:16PM UTC coverage: 70.262% (-1.1%) from 71.395%
9555551525

push

github

prolic
update coveralls repo token

3466 of 4933 relevant lines covered (70.26%)

67.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.36
/src/Internal/NodeEndPoints.php
1
<?php
2

3
/**
4
 * This file is part of `prooph/event-store-client`.
5
 * (c) 2018-2024 Alexander Miertsch <kontakt@codeliner.ws>
6
 * (c) 2018-2024 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace Prooph\EventStoreClient\Internal;
15

16
use Prooph\EventStore\EndPoint;
17
use Prooph\EventStore\Exception\InvalidArgumentException;
18

19
/**
20
 * @internal
21
 *
22
 * @psalm-immutable
23
 */
24
class NodeEndPoints
25
{
26
    private readonly ?EndPoint $tcpEndPoint;
27

28
    private readonly ?EndPoint $secureTcpEndPoint;
29

30
    public function __construct(?EndPoint $tcpEndPoint, ?EndPoint $secureTcpEndPoint = null)
31
    {
32
        if (null === $tcpEndPoint && null === $secureTcpEndPoint) {
410✔
33
            throw new InvalidArgumentException('Both endpoints are null');
×
34
        }
35

36
        $this->tcpEndPoint = $tcpEndPoint;
410✔
37
        $this->secureTcpEndPoint = $secureTcpEndPoint;
410✔
38
    }
39

40
    public function tcpEndPoint(): ?EndPoint
41
    {
42
        return $this->tcpEndPoint;
405✔
43
    }
44

45
    public function secureTcpEndPoint(): ?EndPoint
46
    {
47
        return $this->secureTcpEndPoint;
×
48
    }
49

50
    public function __toString(): string
51
    {
52
        return \sprintf(
×
53
            '[%s, %s]',
×
54
            null === $this->tcpEndPoint ? 'n/a' : $this->tcpEndPoint->__toString(),
×
55
            null === $this->secureTcpEndPoint ? 'n/a' : $this->secureTcpEndPoint->__toString()
×
56
        );
×
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc