Merge "Apply IP blocks to X-Forwarded-For header"
[lhc/web/wiklou.git] / includes / logging / LogPager.php
index af62ce3..908755e 100644 (file)
@@ -35,14 +35,14 @@ class LogPager extends ReverseChronologicalPager {
         * Constructor
         *
         * @param $list LogEventsList
-        * @param $types String or Array: log types to show
-        * @param $performer String: the user who made the log entries
-        * @param $title String|Title: the page title the log entries are for
-        * @param $pattern String: do a prefix search rather than an exact title match
-        * @param $conds Array: extra conditions for the query
+        * @param string $types or Array: log types to show
+        * @param string $performer the user who made the log entries
+        * @param string|Title $title the page title the log entries are for
+        * @param string $pattern do a prefix search rather than an exact title match
+        * @param array $conds extra conditions for the query
         * @param $year Integer: the year to start from
         * @param $month Integer: the month to start from
-        * @param $tagFilter String: tag
+        * @param string $tagFilter tag
         */
        public function __construct( $list, $types = array(), $performer = '', $title = '', $pattern = '',
                $conds = array(), $year = false, $month = false, $tagFilter = '' ) {
@@ -71,7 +71,7 @@ class LogPager extends ReverseChronologicalPager {
        public function getFilterParams() {
                global $wgFilterLogTypes;
                $filters = array();
-               if( count($this->types) ) {
+               if( count( $this->types ) ) {
                        return $filters;
                }
                foreach( $wgFilterLogTypes as $type => $default ) {
@@ -90,7 +90,7 @@ class LogPager extends ReverseChronologicalPager {
         * Set the log reader to return only entries of the given type.
         * Type restrictions enforced here
         *
-        * @param $types String or array: Log types ('upload', 'delete', etc);
+        * @param string $types or array: Log types ('upload', 'delete', etc);
         *   empty string means no restriction
         */
        private function limitType( $types ) {
@@ -122,17 +122,17 @@ class LogPager extends ReverseChronologicalPager {
                if( $hideLogs !== false ) {
                        $this->mConds[] = $hideLogs;
                }
-               if( count($types) ) {
+               if( count( $types ) ) {
                        $this->mConds['log_type'] = $types;
                        // Set typeCGI; used in url param for paging
-                       if( count($types) == 1 ) $this->typeCGI = $types[0];
+                       if( count( $types ) == 1 ) $this->typeCGI = $types[0];
                }
        }
 
        /**
         * Set the log reader to return only entries by the given user.
         *
-        * @param $name String: (In)valid user name
+        * @param string $name (In)valid user name
         * @return bool
         */
        private function limitPerformer( $name ) {
@@ -140,7 +140,7 @@ class LogPager extends ReverseChronologicalPager {
                        return false;
                }
                $usertitle = Title::makeTitleSafe( NS_USER, $name );
-               if( is_null($usertitle) ) {
+               if( is_null( $usertitle ) ) {
                        return false;
                }
                /* Fetch userid at first, if known, provides awesome query plan afterwards */
@@ -154,9 +154,9 @@ class LogPager extends ReverseChronologicalPager {
                        // Paranoia: avoid brute force searches (bug 17342)
                        $user = $this->getUser();
                        if( !$user->isAllowed( 'deletedhistory' ) ) {
-                               $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::DELETED_USER) . ' = 0';
+                               $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0';
                        } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
-                               $this->mConds[] = $this->mDb->bitAnd('log_deleted', LogPage::SUPPRESSED_USER) .
+                               $this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_USER ) .
                                        ' != ' . LogPage::SUPPRESSED_USER;
                        }
                        $this->performer = $usertitle->getText();
@@ -167,7 +167,7 @@ class LogPager extends ReverseChronologicalPager {
         * Set the log reader to return only entries affecting the given page.
         * (For the block and rights logs, this is a user page.)
         *
-        * @param $page String or Title object: Title name
+        * @param string $page or Title object: Title name
         * @param $pattern String
         * @return bool
         */
@@ -209,9 +209,9 @@ class LogPager extends ReverseChronologicalPager {
                // Paranoia: avoid brute force searches (bug 17342)
                $user = $this->getUser();
                if( !$user->isAllowed( 'deletedhistory' ) ) {
-                       $this->mConds[] = $db->bitAnd('log_deleted', LogPage::DELETED_ACTION) . ' = 0';
+                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::DELETED_ACTION) . ' = 0';
                } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
-                       $this->mConds[] = $db->bitAnd('log_deleted', LogPage::SUPPRESSED_ACTION) .
+                       $this->mConds[] = $db->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION) .
                                ' != ' . LogPage::SUPPRESSED_ACTION;
                }
        }
@@ -251,10 +251,10 @@ class LogPager extends ReverseChronologicalPager {
                # avoids site-breaking filesorts.
                } elseif( $this->title || $this->pattern || $this->performer ) {
                        $index['logging'] = array( 'page_time', 'user_time' );
-                       if( count($this->types) == 1 ) {
+                       if( count( $this->types ) == 1 ) {
                                $index['logging'][] = 'log_user_type_time';
                        }
-               } elseif( count($this->types) == 1 ) {
+               } elseif( count( $this->types ) == 1 ) {
                        $index['logging'] = 'type_time';
                } else {
                        $index['logging'] = 'times';