Dotclear


Ignore:
Timestamp:
09/14/18 12:16:17 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

short notation for array (array() → [])

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.urlhandlers.php

    r3731 r3874  
    3333    { 
    3434        $core = &$GLOBALS['core']; 
    35         $t    = new ArrayObject(array($type, $url, $representation, $handler)); 
     35        $t    = new ArrayObject([$type, $url, $representation, $handler]); 
    3636        $core->callBehavior("publicRegisterURL", $t); 
    3737        parent::register($t[0], $t[1], $t[2], $t[3]); 
     
    241241            $GLOBALS['_search'] = !empty($_GET['q']) ? rawurldecode($_GET['q']) : ''; 
    242242            if ($GLOBALS['_search']) { 
    243                 $params = new ArrayObject(array('search' => $GLOBALS['_search'])); 
     243                $params = new ArrayObject(['search' => $GLOBALS['_search']]); 
    244244                $core->callBehavior('publicBeforeSearchCount', $params); 
    245245                $GLOBALS['_search_count'] = $core->blog->getPosts($params, true)->f(0); 
     
    256256 
    257257        $n      = self::getPageNumber($args); 
    258         $params = new ArrayObject(array( 
    259             'lang' => $args)); 
     258        $params = new ArrayObject([ 
     259            'lang' => $args]); 
    260260 
    261261        $core->callBehavior('publicLangBeforeGetLangs', $params, $args); 
     
    286286            self::p404(); 
    287287        } else { 
    288             $params = new ArrayObject(array( 
     288            $params = new ArrayObject([ 
    289289                'cat_url'       => $args, 
    290290                'post_type'     => 'post', 
    291                 'without_empty' => false)); 
     291                'without_empty' => false]); 
    292292 
    293293            $core->callBehavior('publicCategoryBeforeGetCategories', $params, $args); 
     
    317317            self::serveDocument('archive.html'); 
    318318        } elseif (preg_match('|^/([0-9]{4})/([0-9]{2})$|', $args, $m)) { 
    319             $params = new ArrayObject(array( 
     319            $params = new ArrayObject([ 
    320320                'year'  => $m[1], 
    321321                'month' => $m[2], 
    322                 'type'  => 'month')); 
     322                'type'  => 'month']); 
    323323 
    324324            $core->callBehavior('publicArchiveBeforeGetDates', $params, $args); 
     
    349349            $core->blog->withoutPassword(false); 
    350350 
    351             $params = new ArrayObject(array( 
    352                 'post_url' => $args)); 
     351            $params = new ArrayObject([ 
     352                'post_url' => $args]); 
    353353 
    354354            $core->callBehavior('publicPostBeforeGetPosts', $params, $args); 
     
    380380                        $pwd_cookie = json_decode($_COOKIE['dc_passwd']); 
    381381                        if ($pwd_cookie === null) { 
    382                             $pwd_cookie = array(); 
     382                            $pwd_cookie = []; 
    383383                        } else { 
    384384                            $pwd_cookie = (array) $pwd_cookie; 
    385385                        } 
    386386                    } else { 
    387                         $pwd_cookie = array(); 
     387                        $pwd_cookie = []; 
    388388                    } 
    389389 
     
    542542 
    543543        if (preg_match('!^([a-z]{2}(-[a-z]{2})?)/(.*)$!', $args, $m)) { 
    544             $params = new ArrayObject(array('lang' => $m[1])); 
     544            $params = new ArrayObject(['lang' => $m[1]]); 
    545545 
    546546            $args = $m[3]; 
     
    582582 
    583583        if ($cat_url) { 
    584             $params = new ArrayObject(array( 
     584            $params = new ArrayObject([ 
    585585                'cat_url'   => $cat_url, 
    586                 'post_type' => 'post')); 
     586                'post_type' => 'post']); 
    587587 
    588588            $core->callBehavior('publicFeedBeforeGetCategories', $params, $args); 
     
    598598            $subtitle = ' - ' . $_ctx->categories->cat_title; 
    599599        } elseif ($post_id) { 
    600             $params = new ArrayObject(array( 
     600            $params = new ArrayObject([ 
    601601                'post_id'   => $post_id, 
    602                 'post_type' => '')); 
     602                'post_type' => '']); 
    603603 
    604604            $core->callBehavior('publicFeedBeforeGetPosts', $params, $args); 
     
    650650 
    651651            if (!is_array($args)) { 
    652                 $args = array(); 
     652                $args = []; 
    653653            } 
    654654 
     
    668668        $core = &$GLOBALS['core']; 
    669669        if (!is_array($args)) { 
    670             $args = array(); 
     670            $args = []; 
    671671        } 
    672672 
Note: See TracChangeset for help on using the changeset viewer.

Sites map