Skip to content

Commit 4639bab

Browse files
committed
Get rid of pointless null checks
We ensure the values are not null in the constructor.
1 parent 780a572 commit 4639bab

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

src/Model/AnonymousIp.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,12 @@ public function __construct(array $raw)
8686
public function jsonSerialize(): ?array
8787
{
8888
$js = [];
89-
if ($this->isAnonymous !== null) {
90-
$js['is_anonymous'] = $this->isAnonymous;
91-
}
92-
if ($this->isAnonymousVpn !== null) {
93-
$js['is_anonymous_vpn'] = $this->isAnonymousVpn;
94-
}
95-
if ($this->isHostingProvider !== null) {
96-
$js['is_hosting_provider'] = $this->isHostingProvider;
97-
}
98-
if ($this->isPublicProxy !== null) {
99-
$js['is_public_proxy'] = $this->isPublicProxy;
100-
}
101-
if ($this->isResidentialProxy !== null) {
102-
$js['is_residential_proxy'] = $this->isResidentialProxy;
103-
}
104-
if ($this->isTorExitNode !== null) {
105-
$js['is_tor_exit_node'] = $this->isTorExitNode;
106-
}
89+
$js['is_anonymous'] = $this->isAnonymous;
90+
$js['is_anonymous_vpn'] = $this->isAnonymousVpn;
91+
$js['is_hosting_provider'] = $this->isHostingProvider;
92+
$js['is_public_proxy'] = $this->isPublicProxy;
93+
$js['is_residential_proxy'] = $this->isResidentialProxy;
94+
$js['is_tor_exit_node'] = $this->isTorExitNode;
10795
$js['ip_address'] = $this->ipAddress;
10896
$js['network'] = $this->network;
10997

0 commit comments

Comments
 (0)