-
-
Save trikitrok/70fca43eac0655974e357ee6daabd445 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 ClickValidation | |
| { | |
| private $validators | |
| public function __construct( | |
| DomainLogger $domainLogger, | |
| Clock $clock, | |
| ClickPersistence $clickPersistence) | |
| { | |
| $this->validators = [ | |
| new ClickParamsValidator(), | |
| NoBotClickValidator::create($clock, $clickPersistence, $domainLogger)]; | |
| } | |
| public function isValid(array $click) | |
| { | |
| foreach ($this->validators as $validator) { | |
| if (!$validator->isValid($click)) { | |
| return false; | |
| } | |
| } | |
| return true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment