Added NotFoundTrackerMiddlewareTest

This commit is contained in:
Alejandro Celaya
2021-02-08 22:16:15 +01:00
parent 0e165bc7e0
commit d2e0413a48
3 changed files with 98 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ use Shlinkio\Shlink\Core\Entity\Visit;
use function rtrim;
final class NotFoundType
class NotFoundType
{
private string $type;

View File

@@ -29,13 +29,9 @@ class NotFoundTrackerMiddleware implements MiddlewareInterface
if ($notFoundType->isBaseUrl()) {
$this->visitsTracker->trackBaseUrlVisit($visitor);
}
if ($notFoundType->isRegularNotFound()) {
} elseif ($notFoundType->isRegularNotFound()) {
$this->visitsTracker->trackRegularNotFoundVisit($visitor);
}
if ($notFoundType->isInvalidShortUrl()) {
} elseif ($notFoundType->isInvalidShortUrl()) {
$this->visitsTracker->trackInvalidShortUrlVisit($visitor);
}