Use short form array syntax everywhere
[friendica-addons.git] / libertree / libertree.php
old mode 100755 (executable)
new mode 100644 (file)
index 95def07..0b9f839
@@ -155,18 +155,21 @@ function libertree_send(&$a,&$b) {
 
        logger('libertree_send: invoked');
 
-       if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
+       if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
                return;
+       }
 
-       if (! strstr($b['postopts'],'libertree'))
+       if (! strstr($b['postopts'],'libertree')) {
                return;
+       }
 
-       if ($b['parent'] != $b['id'])
+       if ($b['parent'] != $b['id']) {
                return;
+       }
 
        // Dont't post if the post doesn't belong to us.
        // This is a check for forum postings
-       $self = dba::select('contact', array('id'), array('uid' => $b['uid'], 'self' => true), array('limit' => 1));
+       $self = dba::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
        if ($b['contact-id'] != $self['id']) {
                return;
        }
@@ -182,7 +185,7 @@ function libertree_send(&$a,&$b) {
        if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
 
                require_once('include/bb2diaspora.php');
-               $tag_arr = array();
+               $tag_arr = [];
                $tags = '';
                $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
 
@@ -220,11 +223,11 @@ function libertree_send(&$a,&$b) {
                        $body = "## ".html_entity_decode($title)."\n\n".$body;
 
 
-               $params = array(
+               $params = [
                        'text' => $body,
                        'source' => $ltree_source
                //      'token' => $ltree_api_token
-               );
+               ];
 
                $result = post_url($ltree_blog,$params);
                logger('libertree: ' . $result);