Merge branch 'master' into psalm #241
Annotations
10 warnings
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L25
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
public static function existsMx(string $hostname) : bool
{
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
- throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
+ throw new RuntimeException($errorString . sprintf('Failed to get DNS record "%s". ', $hostname), $errorNumber);
});
$hostname = rtrim($hostname, '.') . '.';
$result = dns_get_record($hostname, DNS_MX);
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L25
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
public static function existsMx(string $hostname) : bool
{
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
- throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
+ throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname), $errorNumber);
});
$hostname = rtrim($hostname, '.') . '.';
$result = dns_get_record($hostname, DNS_MX);
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L30
Escaped Mutant for Mutator "UnwrapRtrim":
--- Original
+++ New
@@ @@
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
});
- $hostname = rtrim($hostname, '.') . '.';
+ $hostname = $hostname . '.';
$result = dns_get_record($hostname, DNS_MX);
restore_error_handler();
return count($result) > 0;
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L30
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
});
- $hostname = rtrim($hostname, '.') . '.';
+ $hostname = rtrim($hostname, '.');
$result = dns_get_record($hostname, DNS_MX);
restore_error_handler();
return count($result) > 0;
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L33
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
});
$hostname = rtrim($hostname, '.') . '.';
$result = dns_get_record($hostname, DNS_MX);
- restore_error_handler();
+
return count($result) > 0;
}
/**
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L49
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
public static function existsA(string $hostname) : bool
{
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
- throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
+ throw new RuntimeException($errorString . sprintf('Failed to get DNS record "%s". ', $hostname), $errorNumber);
});
$result = dns_get_record($hostname, DNS_A);
restore_error_handler();
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L49
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
public static function existsA(string $hostname) : bool
{
set_error_handler(static function (int $errorNumber, string $errorString) use($hostname) : bool {
- throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
+ throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname), $errorNumber);
});
$result = dns_get_record($hostname, DNS_A);
restore_error_handler();
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L56
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
throw new RuntimeException(sprintf('Failed to get DNS record "%s". ', $hostname) . $errorString, $errorNumber);
});
$result = dns_get_record($hostname, DNS_A);
- restore_error_handler();
+
return count($result) > 0;
}
/**
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L76
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
/**
* @psalm-suppress PossiblyUndefinedArrayOffset In this cse `explode()` always returns array with 2 elements.
*/
- [, $hostnameOrEmail] = explode('@', $hostnameOrEmail, 2);
+ [, $hostnameOrEmail] = explode('@', $hostnameOrEmail, 3);
}
return self::existsMx($hostnameOrEmail) || self::existsA($hostnameOrEmail);
}
}
|
mutation / PHP 8.1-ubuntu-latest:
src/DnsHelper.php#L78
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
*/
[, $hostnameOrEmail] = explode('@', $hostnameOrEmail, 2);
}
- return self::existsMx($hostnameOrEmail) || self::existsA($hostnameOrEmail);
+ return self::existsMx($hostnameOrEmail) && self::existsA($hostnameOrEmail);
}
}
|