Allow nette/php-generator v4 #86
Annotations
3 warnings
Run infection:
src/BotDetector/BotDetector.php#L27
Escaped Mutant for Mutator "ArrayItemRemoval":
--- Original
+++ New
@@ @@
{
$this->requestStack = $requestStack;
if (null === $popular) {
- $popular = ['Googlebot', 'Bingbot', 'Yahoo! Slurp', 'DuckDuckBot', 'Baiduspider', 'YandexBot', 'facebookexternalhit', 'facebookcatalog', 'ia_archiver'];
+ $popular = ['Bingbot', 'Yahoo! Slurp', 'DuckDuckBot', 'Baiduspider', 'YandexBot', 'facebookexternalhit', 'facebookcatalog', 'ia_archiver'];
}
$this->popular = $popular;
}
|
Run infection:
src/BotDetector/BotDetector.php#L47
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
{
if (!isset($this->cache[$userAgent])) {
$minimalRegex = '#' . implode('|', $this->popular) . '#';
- $minimalMatch = preg_match($minimalRegex, $userAgent) === 1;
+ $minimalMatch = preg_match($minimalRegex, $userAgent) === 2;
$this->cache[$userAgent] = $minimalMatch ?: preg_match(Bots::REGEX, $userAgent) === 1;
}
return $this->cache[$userAgent];
|
Run infection:
src/BotDetector/BotDetector.php#L56
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
}
public function isBotRequest(Request $request = null) : bool
{
- $request = $request ?? $this->requestStack->getMainRequest();
+ $request = $this->requestStack->getMainRequest() ?? $request;
if (null === $request) {
return false;
}
|
Loading