Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
1 / 1
ProxyType
100.00% covered (success)
100.00%
12 / 12
100.00% covered (success)
100.00%
7 / 7
7
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
 isAnonymousVpn
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isPublicProxy
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isResidentialProxy
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isLegitimateProxy
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isTorExitNode
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isHostingProvider
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\IPInfo\Info;
4
5class ProxyType {
6    /** @var bool|null */
7    private $isAnonymousVpn;
8
9    /** @var bool|null */
10    private $isPublicProxy;
11
12    /** @var bool|null */
13    private $isResidentialProxy;
14
15    /** @var bool|null */
16    private $isLegitimateProxy;
17
18    /** @var bool|null */
19    private $isTorExitNode;
20
21    /** @var bool|null */
22    private $isHostingProvider;
23
24    /**
25     * @param bool|null $isAnonymousVpn
26     * @param bool|null $isPublicProxy
27     * @param bool|null $isResidentialProxy
28     * @param bool|null $isLegitimateProxy
29     * @param bool|null $isTorExitNode
30     * @param bool|null $isHostingProvider
31     */
32    public function __construct(
33        ?bool $isAnonymousVpn,
34        ?bool $isPublicProxy,
35        ?bool $isResidentialProxy,
36        ?bool $isLegitimateProxy,
37        ?bool $isTorExitNode,
38        ?bool $isHostingProvider
39    ) {
40        $this->isAnonymousVpn = $isAnonymousVpn;
41        $this->isPublicProxy = $isPublicProxy;
42        $this->isResidentialProxy = $isResidentialProxy;
43        $this->isLegitimateProxy = $isLegitimateProxy;
44        $this->isTorExitNode = $isTorExitNode;
45        $this->isHostingProvider = $isHostingProvider;
46    }
47
48    public function isAnonymousVpn(): ?bool {
49        return $this->isAnonymousVpn;
50    }
51
52    public function isPublicProxy(): ?bool {
53        return $this->isPublicProxy;
54    }
55
56    public function isResidentialProxy(): ?bool {
57        return $this->isResidentialProxy;
58    }
59
60    public function isLegitimateProxy(): ?bool {
61        return $this->isLegitimateProxy;
62    }
63
64    public function isTorExitNode(): ?bool {
65        return $this->isTorExitNode;
66    }
67
68    public function isHostingProvider(): ?bool {
69        return $this->isHostingProvider;
70    }
71}