Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save trikitrok/e5a538fc19f40e6309ea0d52a91729e3 to your computer and use it in GitHub Desktop.
<?php
namespace Trovit\B2B\AdClick\Domain;
class ClickValidation
{
private $validators
public function __construct(ClickValidator $noBotClickValidator)
{
$this->validators = [new ClickParamsValidator(), $noBotClickValidator];
}
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