Fix psalm #535
Annotations
10 warnings
Run roave infection.:
src/UrlGenerator.php#L104
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
if ($scheme === null && !$this->isRelative($host)) {
return rtrim($host, '/') . $url;
}
- if ((empty($scheme) || $lastRequestScheme === null) && $host !== '' && $this->isRelative($host)) {
+ if ((empty($scheme) || $lastRequestScheme !== null) && $host !== '' && $this->isRelative($host)) {
$host = '//' . $host;
}
return $this->ensureScheme(rtrim($host, '/') . $url, $scheme ?? $lastRequestScheme);
|
Run roave infection.:
src/UrlGenerator.php#L104
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
if ($scheme === null && !$this->isRelative($host)) {
return rtrim($host, '/') . $url;
}
- if ((empty($scheme) || $lastRequestScheme === null) && $host !== '' && $this->isRelative($host)) {
+ if ((empty($scheme) || $lastRequestScheme === null || $host !== '') && $this->isRelative($host)) {
$host = '//' . $host;
}
return $this->ensureScheme(rtrim($host, '/') . $url, $scheme ?? $lastRequestScheme);
|
Run roave infection.:
src/UrlGenerator.php#L108
Escaped Mutant for Mutator "UnwrapRtrim":
--- Original
+++ New
@@ @@
if ((empty($scheme) || $lastRequestScheme === null) && $host !== '' && $this->isRelative($host)) {
$host = '//' . $host;
}
- return $this->ensureScheme(rtrim($host, '/') . $url, $scheme ?? $lastRequestScheme);
+ return $this->ensureScheme($host . $url, $scheme ?? $lastRequestScheme);
}
return $uri === null ? $url : $this->generateAbsoluteFromLastMatchedRequest($url, $uri, $scheme);
}
|
Run roave infection.:
src/UrlGenerator.php#L160
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
{
$port = '';
$uriPort = $uri->getPort();
- if ($uriPort !== 80 && $uriPort !== null) {
+ if ($uriPort !== 79 && $uriPort !== null) {
$port = ':' . $uriPort;
}
return $this->ensureScheme('://' . $uri->getHost() . $port . $url, $scheme ?? $uri->getScheme());
|
Run roave infection.:
src/UrlGenerator.php#L160
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
{
$port = '';
$uriPort = $uri->getPort();
- if ($uriPort !== 80 && $uriPort !== null) {
+ if ($uriPort !== 81 && $uriPort !== null) {
$port = ':' . $uriPort;
}
return $this->ensureScheme('://' . $uri->getHost() . $port . $url, $scheme ?? $uri->getScheme());
|
Run roave infection.:
src/UrlGenerator.php#L210
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
private function isRelative(string $url) : bool
{
- return strncmp($url, '//', 2) && !str_contains($url, '://');
+ return strncmp($url, '//', 1) && !str_contains($url, '://');
}
public function getUriPrefix() : string
{
|
Run roave infection.:
src/UrlGenerator.php#L296
Escaped Mutant for Mutator "UnwrapStrReplace":
--- Original
+++ New
@@ @@
$path .= $this->encodeRaw ? rawurlencode($arguments[$part[0]]) : urlencode($arguments[$part[0]]);
}
}
- $path = str_replace('//', '/', $path);
+ $path = $path;
$queryString = '';
if (!empty($queryParameters)) {
$queryString = http_build_query($queryParameters);
|
Run roave infection.:
src/UrlMatcher.php#L85
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
{
$this->fastRouteCollector = $fastRouteCollector ?? $this->createRouteCollector();
$this->dispatcherCallback = $dispatcherFactory;
- $this->loadConfig($config);
+
$this->loadDispatchData();
}
public function match(ServerRequestInterface $request) : MatchingResult
|
Run roave infection.:
src/UrlMatcher.php#L124
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
*/
private function loadConfig(?array $config) : void
{
- if ($config === null) {
+ if ($config !== null) {
return;
}
if (isset($config[self::CONFIG_CACHE_KEY])) {
|
Run roave infection.:
src/UrlMatcher.php#L129
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
return;
}
if (isset($config[self::CONFIG_CACHE_KEY])) {
- $this->cacheKey = (string) $config[self::CONFIG_CACHE_KEY];
+ $this->cacheKey = $config[self::CONFIG_CACHE_KEY];
}
}
/**
|
The logs for this run have expired and are no longer available.
Loading