Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Last active July 7, 2019 14:47
Show Gist options
  • Select an option

  • Save trikitrok/70fca43eac0655974e357ee6daabd445 to your computer and use it in GitHub Desktop.

Select an option

Save trikitrok/70fca43eac0655974e357ee6daabd445 to your computer and use it in GitHub Desktop.
<?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