]> git.mxchange.org Git - friendica.git/blobdiff - mod/viewcontacts.php
Normalize App parameter declaration (mod folder, 3 out of 3)
[friendica.git] / mod / viewcontacts.php
index 01a90d3c49f399ce977138ad3042e2b9512b90d2..55afda9b635f0840597e18423709b33a756e4b15 100644 (file)
@@ -2,7 +2,7 @@
 require_once('include/Contact.php');
 require_once('include/contact_selectors.php');
 
-function viewcontacts_init(&$a) {
+function viewcontacts_init(App $a) {
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                return;
@@ -16,8 +16,9 @@ function viewcontacts_init(&$a) {
                        dbesc($nick)
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        return;
+               }
 
                $a->data['user'] = $r[0];
                $a->profile_uid = $r[0]['uid'];
@@ -28,7 +29,7 @@ function viewcontacts_init(&$a) {
 }
 
 
-function viewcontacts_content(&$a) {
+function viewcontacts_content(App $a) {
        require_once("mod/proxy.php");
 
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
@@ -54,7 +55,7 @@ function viewcontacts_content(&$a) {
                dbesc(NETWORK_DIASPORA),
                dbesc(NETWORK_OSTATUS)
        );
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                $a->set_pager_total($r[0]['total']);
 
        $r = q("SELECT * FROM `contact`
@@ -68,16 +69,18 @@ function viewcontacts_content(&$a) {
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
        );
-       if(!dbm::is_result($r)) {
+       if (!dbm::is_result($r)) {
                info(t('No contacts.').EOL);
                return $o;
        }
 
        $contacts = array();
 
-       foreach($r as $rr) {
-               if($rr['self'])
+       foreach ($r as $rr) {
+               /// @TODO This triggers an E_NOTICE if 'self' is not there
+               if ($rr['self']) {
                        continue;
+               }
 
                $url = $rr['url'];