Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Net/DNS2.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down Expand Up @@ -323,7 +325,7 @@ public function setServers($nameservers)
//
// otherwise, see if it's a path to a resolv.conf file and if so, load it
//
if (is_array($nameservers)) {
if (is_[$nameservers]) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_[$nameservers] is invalid PHP syntax and will cause a parse error. Replace with is_array($nameservers) so the method can correctly branch between array input vs resolv.conf path.

Suggested change
if (is_[$nameservers]) {
if (is_array($nameservers)) {

Copilot uses AI. Check for mistakes.

//
// make sure all the name servers are IP addresses (either v4 or v6)
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/BitMap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Cache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
6 changes: 4 additions & 2 deletions Net/DNS2/Cache/File.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down Expand Up @@ -81,7 +83,7 @@ public function open($cache_file, $size, $serializer)
$decoded = unserialize($data);
}

if (is_array($decoded) == true) {
if (is_[$decoded] == true) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_[$decoded] is invalid PHP syntax and will cause a parse error. Replace with is_array($decoded) to validate decoded cache contents.

Suggested change
if (is_[$decoded] == true) {
if (is_array($decoded) == true) {

Copilot uses AI. Check for mistakes.

$this->cache_data = $decoded;
} else {
Expand Down Expand Up @@ -173,7 +175,7 @@ public function __destruct()
$decoded = unserialize($data);
}

if (is_array($decoded) == true) {
if (is_[$decoded] == true) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_[$decoded] is invalid PHP syntax and will cause a parse error. Replace with is_array($decoded) before merging the decoded cache data.

Suggested change
if (is_[$decoded] == true) {
if (is_array($decoded) == true) {

Copilot uses AI. Check for mistakes.

$this->cache_data = array_merge($c, $decoded);
}
Expand Down
6 changes: 4 additions & 2 deletions Net/DNS2/Cache/Shm.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down Expand Up @@ -118,7 +120,7 @@ public function open($cache_file, $size, $serializer)
$decoded = unserialize($data);
}

if (is_array($decoded) == true) {
if (is_[$decoded] == true) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_[$decoded] is invalid PHP syntax and will cause a parse error. This should be is_array($decoded) to validate decoded cache contents.

Suggested change
if (is_[$decoded] == true) {
if (is_array($decoded) == true) {

Copilot uses AI. Check for mistakes.

$this->cache_data = $decoded;
} else {
Expand Down Expand Up @@ -216,7 +218,7 @@ public function __destruct()
$decoded = unserialize($data);
}

if (is_array($decoded) == true) {
if (is_[$decoded] == true) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_[$decoded] is invalid PHP syntax and will cause a parse error. Replace with is_array($decoded) before merging the decoded cache data.

Suggested change
if (is_[$decoded] == true) {
if (is_array($decoded) == true) {

Copilot uses AI. Check for mistakes.

$this->cache_data = array_merge($c, $decoded);
}
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Exception.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Header.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Lookups.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Names.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
4 changes: 3 additions & 1 deletion Net/DNS2/Notifier.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down Expand Up @@ -104,7 +106,7 @@ public function add(Net_DNS2_RR $rr)
//
// add the RR to the "notify" section
//
if (!in_array($rr, $this->_packet->answer)) {
if (!in_[$rr, $this->_packet->answer]) {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in_[$rr, $this->_packet->answer] is invalid PHP syntax and will cause a parse error. Replace with in_array($rr, $this->_packet->answer).

Suggested change
if (!in_[$rr, $this->_packet->answer]) {
if (!in_array($rr, $this->_packet->answer)) {

Copilot uses AI. Check for mistakes.
$this->_packet->answer[] = $rr;
}
return true;
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Packet.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Packet/Request.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Packet/Response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/PrivateKey.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/Question.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/A.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/AAAA.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/AFSDB.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/AMTRELAY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/ANY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/APL.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/ATMA.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/AVC.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CAA.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CDNSKEY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CDS.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CERT.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CNAME.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/CSYNC.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/DHCID.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/DLV.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/DNAME.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/DNSKEY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/DS.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/EID.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/EUI48.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/EUI64.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/HINFO.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/HIP.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/IPSECKEY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/ISDN.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
2 changes: 2 additions & 0 deletions Net/DNS2/RR/KEY.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* DNS Library for handling lookups and updates.
*
Expand Down
Loading
Loading