ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AssertionValidator.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
12 {
16  protected $constraints;
17 
22 
27 
32  public function __construct(
35  ) {
36  $this->identityProvider = $identityProvider;
37  $this->serviceProvider = $serviceProvider;
38  }
39 
41  {
42  if ($constraint instanceof IdentityProviderAware) {
43  $constraint->setIdentityProvider($this->identityProvider);
44  }
45 
46  if ($constraint instanceof ServiceProviderAware) {
47  $constraint->setServiceProvider($this->serviceProvider);
48  }
49 
50  $this->constraints[] = $constraint;
51  }
52 
53  public function validate(Assertion $assertion)
54  {
55  $result = new Result();
56  foreach ($this->constraints as $validator) {
57  $validator->validate($assertion, $result);
58  }
59 
60  return $result;
61  }
62 }
__construct(IdentityProvider $identityProvider, ServiceProvider $serviceProvider)
Basic configuration wrapper.
Basic Configuration Wrapper.
$result
addConstraintValidator(AssertionConstraintValidator $constraint)
Simple Result object.
Definition: Result.php:10
Interface for triggering setter injection.
Interface for triggering setter injection.