示例#1
0
 /**
  * @param string $name
  */
 public function __construct($name)
 {
     Assertion::nonEmptyString($name, 'name');
     $this->surname = $name;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('is_regexp', 'scope'));
     return new self($data['scope'], $data['is_regexp']);
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('endpoint', 'index', 'is_default'));
     return new self(Endpoint::deserialize($data['endpoint']), $data['index'], $data['is_default']);
 }
示例#4
0
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('entity_id', 'entity_type'));
     return new self(EntityId::deserialize($data['entity_id']), EntityType::deserialize($data['entity_type']));
 }
示例#5
0
 /**
  ** @param string $company
  */
 public function __construct($company)
 {
     Assertion::nonEmptyString($company, 'company');
     $this->company = $company;
 }
 /**
  * @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 string $telephoneNumber
  */
 public function __construct($telephoneNumber)
 {
     Assertion::nonEmptyString($telephoneNumber, 'telephoneNumber');
     $this->telephoneNumber = $telephoneNumber;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $contactPersons = array_map(function ($contactPerson) {
         return ContactPerson::deserialize($contactPerson);
     }, $data);
     return new self($contactPersons);
 }
示例#9
0
 /**
  * @param string $type
  */
 public function __construct($type)
 {
     Assertion::inArray($type, array(self::TYPE_SP, self::TYPE_IDP), 'EntityType must be one of EntityType::TYPE_SP or EntityType::TYPE_IDP');
     $this->type = $type;
 }
 /**
  * @param string
  * @return bool
  */
 public function matches($string)
 {
     Assertion::string($string, 'String to match pattern against is not a string, "%s" given');
     return preg_match($this->pattern, $string) === 1;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $organizationUrls = array_map(function ($organizationUrl) {
         return OrganizationUrl::deserialize($organizationUrl);
     }, $data);
     return new self($organizationUrls);
 }
示例#12
0
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('binding', 'location', 'response_location'));
     return new self(Binding::deserialize($data['binding']), $data['location'], $data['response_location']);
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('contact_type', 'email_address_list', 'telephone_number_list', 'given_name', 'surname', 'company'));
     $contact = new self(ContactType::deserialize($data['contact_type']), EmailAddressList::deserialize($data['email_address_list']), TelephoneNumberList::deserialize($data['telephone_number_list']));
     if ($data['given_name']) {
         $contact->givenName = GivenName::deserialize($data['given_name']);
     }
     if ($data['surname']) {
         $contact->surname = Surname::deserialize($data['surname']);
     }
     if ($data['company']) {
         $contact->company = Company::deserialize($data['company']);
     }
     return $contact;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $telephoneNumbers = array_map(function ($telephoneNumber) {
         return TelephoneNumber::deserialize($telephoneNumber);
     }, $data);
     return new self($telephoneNumbers);
 }
示例#15
0
 /**
  * @param string $givenName
  */
 public function __construct($givenName)
 {
     Assertion::nonEmptyString($givenName, 'givenName');
     $this->givenName = $givenName;
 }
示例#16
0
 /**
  * @param string $entityId
  */
 public function __construct($entityId)
 {
     Assertion::nonEmptyString($entityId, 'entityId');
     $this->entityId = $entityId;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $displayNames = array_map(function ($displayName) {
         return OrganizationDisplayName::deserialize($displayName);
     }, $data);
     return new self($displayNames);
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $scopes = array_map(function ($scope) {
         return ShibbolethMetadataScope::deserialize($scope);
     }, $data);
     return new self($scopes);
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $emailAddresses = array_map(function ($emailAddress) {
         return EmailAddress::deserialize($emailAddress);
     }, $data);
     return new self($emailAddresses);
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('name', 'language'));
     return new self($data['name'], $data['language']);
 }
示例#21
0
 /**
  ** @param string $type one of the ContactType::TYPE_* constants
  */
 public function __construct($type)
 {
     $validMessage = 'one of "ContactType::' . implode(', ContactType::', self::$validTypes) . '"';
     Assertion::inArray($type, self::$validTypes, $validMessage);
     $this->contactType = $type;
 }
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     $nameIdFormats = array_map(function ($nameIdFormat) {
         return NameIdFormat::deserialize($nameIdFormat);
     }, $data);
     return new self($nameIdFormats);
 }
示例#23
0
 public static function deserialize($data)
 {
     Assertion::isArray($data);
     Assertion::keysExist($data, array('organization_names', 'organization_display_names', 'organization_urls'));
     return new self(OrganizationNameList::deserialize($data['organization_names']), OrganizationDisplayNameList::deserialize($data['organization_display_names']), OrganizationUrlList::deserialize($data['organization_urls']));
 }
示例#24
0
 public static function deserialize($data)
 {
     Assertion::nonEmptyString($data, 'data');
     return new self($data);
 }
示例#25
0
 /**
  * @param string $emailAddress RFC 822 compliant email address
  */
 public function __construct($emailAddress)
 {
     Assertion::email($emailAddress);
     $this->emailAddress = $emailAddress;
 }