From 8f3da6ee9b6082e6853a0166470316e5b19867e3 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sat, 11 Feb 2012 21:57:38 +0100 Subject: [PATCH] Small coding style update Fixup OC_Contacts_App --- apps/contacts/lib/app.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index 944bd6e83af..5e58f9e928f 100644 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -10,7 +10,7 @@ * This class manages our app actions */ OC_Contacts_App::$l10n = new OC_L10N('contacts'); -class OC_Contacts_App{ +class OC_Contacts_App { public static $l10n; /** @@ -18,7 +18,7 @@ class OC_Contacts_App{ * @param int $id of contact * @param Sabre_VObject_Component $vcard to render */ - public static function renderDetails($id, $vcard, $new=false){ + public static function renderDetails($id, $vcard, $new=false) { $property_types = self::getAddPropertyOptions(); $adr_types = self::getTypesOfProperty('ADR'); $phone_types = self::getTypesOfProperty('TEL'); @@ -46,9 +46,9 @@ class OC_Contacts_App{ OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page ))); } - public static function getAddressbook($id){ + public static function getAddressbook($id) { $addressbook = OC_Contacts_Addressbook::find( $id ); - if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()){ + if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) { if ($addressbook === false) { OC_Log::write('contacts', 'Addressbook not found: '. $id, OC_Log::ERROR); } @@ -61,9 +61,9 @@ class OC_Contacts_App{ return $addressbook; } - public static function getContactObject($id){ + public static function getContactObject($id) { $card = OC_Contacts_VCard::find( $id ); - if( $card === false ){ + if( $card === false ) { OC_Log::write('contacts', 'Contact could not be found: '.$id, OC_Log::ERROR); OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Contact could not be found.').' '.$id))); exit(); @@ -77,12 +77,12 @@ class OC_Contacts_App{ * @brief Gets the VCard as an OC_VObject * @returns The card or null if the card could not be parsed. */ - public static function getContactVCard($id){ + public static function getContactVCard($id) { $card = self::getContactObject( $id ); $vcard = OC_VObject::parse($card['carddata']); // Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly... - if(!is_null($vcard) && !$vcard->__isset('N')){ + if(!is_null($vcard) && !$vcard->__isset('N')) { $appinfo = $info=OC_App::getAppInfo('contacts'); if($appinfo['version'] >= 5) { OC_Log::write('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OC_Log::DEBUG); @@ -100,10 +100,10 @@ class OC_Contacts_App{ return $vcard; } - public static function getPropertyLineByChecksum($vcard, $checksum){ + public static function getPropertyLineByChecksum($vcard, $checksum) { $line = null; - for($i=0;$ichildren);$i++){ - if(md5($vcard->children[$i]->serialize()) == $checksum ){ + for($i=0;$ichildren);$i++) { + if(md5($vcard->children[$i]->serialize()) == $checksum ) { $line = $i; break; } @@ -114,7 +114,7 @@ class OC_Contacts_App{ /** * @return array of vcard prop => label */ - public static function getAddPropertyOptions(){ + public static function getAddPropertyOptions() { $l10n = self::$l10n; return array( 'ADR' => $l10n->t('Address'), @@ -127,9 +127,9 @@ class OC_Contacts_App{ /** * @return types for property $prop */ - public static function getTypesOfProperty($prop){ + public static function getTypesOfProperty($prop) { $l = self::$l10n; - switch($prop){ + switch($prop) { case 'ADR': return array( 'WORK' => $l->t('Work'), -- 2.39.5