-
-
Save trikitrok/c4a928f6f7420a339240f0f52fe4f8b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Trovit\B2B\AdClick\Domain; | |
| class NoBotClickValidator implements ClickValidator | |
| { | |
| private $botClickDetector; | |
| private $domainLogger; | |
| public function __construct( | |
| BotClickDetector $botClickDetector, | |
| DomainLogger $domainLogger | |
| ) | |
| { | |
| $this->botClickDetector = $botClickDetector; | |
| $this->domainLogger = $domainLogger; | |
| } | |
| public function isValid(array $click) | |
| { | |
| $clickMadeByBot = $this->botClickDetector->isBot($click['userIp']); | |
| if ($clickMadeByBot) { | |
| $this->domainLogger->logBotClick($click); | |
| return false; | |
| } | |
| return true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment