Fix merging of query parameters with non-substituted arguments in UrlGenerator
#564
Annotations
10 warnings
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L124
Escaped Mutant for Mutator "UnwrapRtrim":
--- Original
+++ New
@@ @@
if ($host !== '' && $isRelativeHost) {
$host = '//' . $host;
}
- return $this->ensureScheme(rtrim($host, '/') . $url, $scheme);
+ return $this->ensureScheme($host . $url, $scheme);
}
return $uri === null ? $url : $this->generateAbsoluteFromLastMatchedRequest($url, $uri, $scheme);
}
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L181
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());
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L181
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());
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L231
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
{
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L319
Escaped Mutant for Mutator "UnwrapStrReplace":
--- Original
+++ New
@@ @@
}
unset($notSubstitutedArguments[$part[0]]);
}
- $path = str_replace('//', '/', $path);
+ $path = $path;
$queryString = '';
$queryParameters += $notSubstitutedArguments;
if (!empty($queryParameters)) {
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlGenerator.php#L327
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
if (!empty($queryParameters)) {
$queryString = http_build_query($queryParameters);
}
- return $path . (!empty($queryString) ? '?' . $queryString : '') . ($hash !== null ? '#' . $hash : '');
+ return $path . ($hash !== null ? '#' . $hash : '') . (!empty($queryString) ? '?' . $queryString : '');
}
}
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlMatcher.php#L86
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
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlMatcher.php#L125
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])) {
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlMatcher.php#L130
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];
}
}
/**
|
mutation / PHP 8.1-ubuntu-latest:
src/UrlMatcher.php#L217
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
{
foreach ($this->routeCollection->getRoutes() as $route) {
if (!$route->getData('hasMiddlewares')) {
- continue;
+ break;
}
$hosts = $route->getData('hosts');
$count = count($hosts);
|