/**
  * @param Callable $predicate
  * @return null|ContactPerson
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->contactPersons as $contactPerson) {
         if (call_user_func($predicate, $contactPerson) === true) {
             return $contactPerson;
         }
     }
     return null;
 }
 /**
  * @param Callable $predicate
  * @return null|NameIdFormat
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->nameIdFormats as $nameIdFormat) {
         if (call_user_func($predicate, $nameIdFormat) === true) {
             return $nameIdFormat;
         }
     }
     return null;
 }
 /**
  * @param Callable $predicate
  * @return null|TelephoneNumber
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->telephoneNumbers as $telephoneNumber) {
         if (call_user_func($predicate, $telephoneNumber) === true) {
             return $telephoneNumber;
         }
     }
     return null;
 }
 /**
  * @param Callable $predicate
  * @return null|EmailAddress
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->emailAddresses as $emailAddress) {
         if (call_user_func($predicate, $emailAddress) === true) {
             return $emailAddress;
         }
     }
     return null;
 }
 /**
  * @param Callable $predicate
  * @return null|OrganizationUrl
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->organizationUrls as $organizationUrl) {
         if (call_user_func($predicate, $organizationUrl) === true) {
             return $organizationUrl;
         }
     }
     return null;
 }
Ejemplo n.º 6
0
 /**
  * @test
  *
  * @dataProvider validCallableProvider
  *
  * @param Callable $callable
  */
 public function valid_callables_assertion_succeeds_if_value_is_a_callable($callable)
 {
     $exceptionCaught = false;
     try {
         Assertion::isCallable($callable, 'callable');
     } catch (InvalidArgumentException $exception) {
         $exceptionCaught = true;
     }
     $this->assertFalse($exceptionCaught, 'A valid callable should not cause an exception to be thrown');
 }
 /**
  * @param Callable $predicate
  * @return null|ShibbolethMetadataScope
  */
 public function find($predicate)
 {
     Assertion::isCallable($predicate, 'predicate');
     foreach ($this->scopes as $shibbolethMetadataScope) {
         if (call_user_func($predicate, $shibbolethMetadataScope) === true) {
             return $shibbolethMetadataScope;
         }
     }
     return null;
 }