예제 #1
0
 /**
  * Set Phone (Telefone)
  * @param PhoneInterface|array $phone
  * @return AddressInterface
  */
 public function setPhone($phone)
 {
     if (!is_null($phone)) {
         $this->phone = Phone::factory($phone);
     } else {
         $this->phone = null;
     }
     return $this;
 }
 /**
  * @param array $data
  * @param array|PhoneInterface $phone Keys:areaCode|countryCode|number
  * @return TravelCheckout
  */
 public function createCellPhoneChargerCheckout(array $data, $phone)
 {
     if (!$phone instanceof PhoneInterface) {
         $phone = Phone::factory($phone);
     }
     $dataFacade = new DataFacade();
     $checkoutData = $dataFacade->ensureInstances($data);
     $checkout = new CellphoneChargerCheckout($checkoutData);
     $checkout->setPhone($phone);
     return $checkout;
 }
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testStringFactoryWithoutDdiAndDdd()
 {
     Phone::factory('980848055');
 }