コード例 #1
0
 public function __construct(Endpoint $endpoint, $index, $isDefault = false)
 {
     Assertion::integer($index);
     Assertion::boolean($isDefault);
     $this->endpoint = $endpoint;
     $this->index = $index;
     $this->isDefault = $isDefault;
 }
コード例 #2
0
 /**
  * @param int $index
  * @return TelephoneNumber
  */
 public function get($index)
 {
     Assertion::integer($index);
     if ($index < 0) {
         throw IndexOutOfBoundsException::tooLow($index, 0);
     }
     if ($index > count($this->telephoneNumbers) - 1) {
         throw IndexOutOfBoundsException::tooHigh($index, count($this->telephoneNumbers) - 1);
     }
     return $this->telephoneNumbers[$index];
 }
コード例 #3
0
 /**
  * @param int $index
  * @return NameIdFormat
  */
 public function get($index)
 {
     Assertion::integer($index);
     if ($index < 0) {
         throw IndexOutOfBoundsException::tooLow($index, 0);
     }
     if ($index > count($this->nameIdFormats) - 1) {
         throw IndexOutOfBoundsException::tooHigh($index, count($this->nameIdFormats) - 1);
     }
     return $this->nameIdFormats[$index];
 }
コード例 #4
0
 /**
  * @param int $index
  * @return OrganizationDisplayName
  */
 public function get($index)
 {
     Assertion::integer($index);
     if ($index < 0) {
         throw IndexOutOfBoundsException::tooLow($index, 0);
     }
     if ($index > count($this->organizationDisplayNames) - 1) {
         throw IndexOutOfBoundsException::tooHigh($index, count($this->organizationDisplayNames) - 1);
     }
     return $this->organizationDisplayNames[$index];
 }