• 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

61.54
/src/SystemData/InspectionResult.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\SystemData;
15

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

19
/**
20
 * @internal
21
 *
22
 * @psalm-immutable
23
 */
24
class InspectionResult
25
{
26
    private InspectionDecision $inspectionDecision;
27

28
    private string $description;
29

30
    private ?EndPoint $tcpEndPoint;
31

32
    private ?EndPoint $secureTcpEndPoint;
33

34
    public function __construct(
35
        InspectionDecision $decision,
36
        string $description,
37
        ?EndPoint $tcpEndPoint = null,
38
        ?EndPoint $secureTcpEndPoint = null
39
    ) {
40
        if ($decision === InspectionDecision::Reconnect) {
396✔
41
            if (null === $tcpEndPoint) {
×
42
                throw new InvalidArgumentException('TcpEndPoint is null for reconnect');
×
43
            }
44
        } elseif (null !== $tcpEndPoint) {
396✔
45
            throw new InvalidArgumentException('TcpEndPoint is not null for decision ' . $decision->name);
×
46
        }
47

48
        $this->inspectionDecision = $decision;
396✔
49
        $this->description = $description;
396✔
50
        $this->tcpEndPoint = $tcpEndPoint;
396✔
51
        $this->secureTcpEndPoint = $secureTcpEndPoint;
396✔
52
    }
53

54
    /** @psalm-pure */
55
    public function decision(): InspectionDecision
56
    {
57
        return $this->inspectionDecision;
396✔
58
    }
59

60
    /** @psalm-pure */
61
    public function description(): string
62
    {
63
        return $this->description;
396✔
64
    }
65

66
    /** @psalm-pure */
67
    public function tcpEndPoint(): ?EndPoint
68
    {
69
        return $this->tcpEndPoint;
×
70
    }
71

72
    /** @psalm-pure */
73
    public function secureTcpEndPoint(): ?EndPoint
74
    {
75
        return $this->secureTcpEndPoint;
×
76
    }
77
}
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

© 2025 Coveralls, Inc