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

azjezz / psl / 23102826194

15 Mar 2026 03:51AM UTC coverage: 95.602% (-0.006%) from 95.608%
23102826194

push

github

web-flow
bc(socks): introduce configuration object (#638)

7 of 10 new or added lines in 2 files covered. (70.0%)

10522 of 11006 relevant lines covered (95.6%)

34.86 hits per line

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

25.0
/src/Psl/Socks/Configuration.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Psl\Socks;
6

7
use SensitiveParameter;
8

9
/**
10
 * Configuration for SOCKS5 proxy connections.
11
 */
12
final readonly class Configuration
13
{
14
    /**
15
     * @param non-empty-string $proxyHost SOCKS5 proxy server hostname or IP.
16
     * @param int<0, 65535> $proxyPort SOCKS5 proxy server port.
17
     * @param non-empty-string|null $username Optional authentication username.
18
     * @param non-empty-string|null $password Optional authentication password.
19
     */
20
    public function __construct(
21
        public string $proxyHost,
22
        public int $proxyPort,
23
        public null|string $username = null,
24
        #[SensitiveParameter]
25
        public null|string $password = null,
26
    ) {}
7✔
27

28
    /**
29
     * @param non-empty-string $proxyHost
30
     *
31
     * @psalm-mutation-free
32
     */
33
    public function withProxyHost(string $proxyHost): self
34
    {
NEW
35
        return new self($proxyHost, $this->proxyPort, $this->username, $this->password);
×
36
    }
37

38
    /**
39
     * @param int<0, 65535> $proxyPort
40
     *
41
     * @psalm-mutation-free
42
     */
43
    public function withProxyPort(int $proxyPort): self
44
    {
NEW
45
        return new self($this->proxyHost, $proxyPort, $this->username, $this->password);
×
46
    }
47

48
    /**
49
     * @param non-empty-string|null $username
50
     * @param non-empty-string|null $password
51
     *
52
     * @psalm-mutation-free
53
     */
54
    public function withCredentials(null|string $username, #[SensitiveParameter] null|string $password): self
55
    {
NEW
56
        return new self($this->proxyHost, $this->proxyPort, $username, $password);
×
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