Exemplo n.º 1
0
 public function testPhoneFormatEn()
 {
     $country = 'GB';
     $this->assertEquals('+44 7795 841283', Phone::format('07-795-841-283', ['country' => $country]));
     $this->assertEquals('07795 841283', Phone::format('07-795-841-283', ['format' => 'national', 'country' => $country]));
     $this->assertEquals('tel:+44-7795-841283', Phone::format('07-795-841-283', ['format' => 'uri', 'country' => $country]));
     $this->assertEquals('+447795841283', Phone::format('07-795-841-283', ['format' => 'short', 'country' => $country]));
 }
Exemplo n.º 2
0
 /**
  * @param  string $phone number
  * @return string formated phone
  */
 public function __setPhone($phone)
 {
     return Phone::format($phone, ['format' => 'short']);
 }
Exemplo n.º 3
0
 /**
  * @param  string $phone number
  * @param  array $options args
  * @return formated phone
  */
 public function phone($phone, $options = [])
 {
     return Phone::format($phone, $options);
 }