Skip to content

Commit

Permalink
Merge pull request #15 from rapidwebltd/analysis-ze0YPP
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
DivineOmega committed May 20, 2016
2 parents 38b1893 + 4113cd2 commit 77842c2
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions factories/ContactFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@ public static function getAll()

$contactGDNodes = $xmlContactsEntry->children('http://schemas.google.com/g/2005');
foreach ($contactGDNodes as $key => $value) {
switch ($key) {
case 'organization':
$contactDetails[$key]['orgName'] = (string) $value->orgName;
$contactDetails[$key]['orgTitle'] = (string) $value->orgTitle;
break;
case 'email':
$attributes = $value->attributes();
$emailadress=(string)$attributes['address'];
$emailtype=substr(strstr($attributes['rel'],"#"),1);
$contactDetails[$key][$emailtype]=$emailadress;
break;
case 'phoneNumber':
$attributes = $value->attributes();
$uri=(string)$attributes['uri'];
$type=substr(strstr($attributes['rel'],"#"),1);
$e164=substr(strstr($uri,":"),1);
$contactDetails[$key][$type]=$e164;
break;
default:
$contactDetails[$key] = (string) $value;
break;
}
switch ($key) {
case 'organization':
$contactDetails[$key]['orgName'] = (string) $value->orgName;
$contactDetails[$key]['orgTitle'] = (string) $value->orgTitle;
break;
case 'email':
$attributes = $value->attributes();
$emailadress = (string) $attributes['address'];
$emailtype = substr(strstr($attributes['rel'], '#'), 1);
$contactDetails[$key][$emailtype] = $emailadress;
break;
case 'phoneNumber':
$attributes = $value->attributes();
$uri = (string) $attributes['uri'];
$type = substr(strstr($attributes['rel'], '#'), 1);
$e164 = substr(strstr($uri, ':'), 1);
$contactDetails[$key][$type] = $e164;
break;
default:
$contactDetails[$key] = (string) $value;
break;
}
}

$contactsArray[] = new Contact($contactDetails);
Expand Down

0 comments on commit 77842c2

Please sign in to comment.