| Conditions | 4 |
| Paths | 6 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function text() { |
||
| 42 | |||
| 43 | if ( $this->type == "" ) { |
||
| 44 | $this->type = "WORK"; |
||
| 45 | } |
||
| 46 | |||
| 47 | $adr = []; |
||
| 48 | |||
| 49 | // Expected sequence as defined by |
||
| 50 | // https://tools.ietf.org/html/rfc6350#section-6.3.1 |
||
| 51 | $map = [ |
||
| 52 | 'pobox', |
||
| 53 | 'ext', |
||
| 54 | 'street', |
||
| 55 | 'locality', |
||
| 56 | 'region', |
||
| 57 | 'code', |
||
| 58 | 'country' |
||
| 59 | ]; |
||
| 60 | |||
| 61 | foreach ( $map as $k ) { |
||
| 62 | $adr[] = isset( $this->adr[$k] ) ? vCard::escape( $this->adr[$k] ) : ''; |
||
| 63 | } |
||
| 64 | |||
| 65 | return "ADR;TYPE=$this->type;CHARSET=UTF-8:" . implode( ';', $adr ) . "\r\n"; |
||
| 66 | } |
||
| 67 | |||
| 69 |