Add public keywords to the QueryPage base class
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Sat, 18 Jul 2015 19:51:07 +0000 (14:51 -0500)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Sat, 18 Jul 2015 19:51:07 +0000 (14:51 -0500)
A lot more methods do not have visibility keywords. Some probably
should be private, a lot need to be protected, but all this will be
a breaking change. In this patch I'm focusing on methods that are
already used as public methods. The added public keyword is not a
breaking change because it's the default anyway.

Change-Id: I52e34209557b00f97a4e68250afbeb7647b64146

includes/specialpage/QueryPage.php

index 69e1d8c..3c8b742 100644 (file)
@@ -141,7 +141,7 @@ abstract class QueryPage extends SpecialPage {
         * @return array
         * @since 1.18
         */
-       function getQueryInfo() {
+       public function getQueryInfo() {
                return null;
        }
 
@@ -178,7 +178,7 @@ abstract class QueryPage extends SpecialPage {
         * @return bool
         * @since 1.18
         */
-       function usesTimestamps() {
+       public function usesTimestamps() {
                return false;
        }
 
@@ -198,7 +198,7 @@ abstract class QueryPage extends SpecialPage {
         *
         * @return bool
         */
-       function isExpensive() {
+       public function isExpensive() {
                return $this->getConfig()->get( 'DisableQueryPages' );
        }
 
@@ -219,7 +219,7 @@ abstract class QueryPage extends SpecialPage {
         *
         * @return bool
         */
-       function isCached() {
+       public function isCached() {
                return $this->isExpensive() && $this->getConfig()->get( 'MiserMode' );
        }
 
@@ -294,7 +294,7 @@ abstract class QueryPage extends SpecialPage {
         * @throws DBError|Exception
         * @return bool|int
         */
-       function recache( $limit, $ignoreErrors = true ) {
+       public function recache( $limit, $ignoreErrors = true ) {
                if ( !$this->isCacheable() ) {
                        return 0;
                }
@@ -370,7 +370,7 @@ abstract class QueryPage extends SpecialPage {
         * @return ResultWrapper
         * @since 1.18
         */
-       function reallyDoQuery( $limit, $offset = false ) {
+       public function reallyDoQuery( $limit, $offset = false ) {
                $fname = get_class( $this ) . "::reallyDoQuery";
                $dbr = $this->getRecacheDB();
                $query = $this->getQueryInfo();
@@ -421,7 +421,7 @@ abstract class QueryPage extends SpecialPage {
         * @param int|bool $limit
         * @return ResultWrapper
         */
-       function doQuery( $offset = false, $limit = false ) {
+       public function doQuery( $offset = false, $limit = false ) {
                if ( $this->isCached() && $this->isCacheable() ) {
                        return $this->fetchFromCache( $limit, $offset );
                } else {
@@ -436,7 +436,7 @@ abstract class QueryPage extends SpecialPage {
         * @return ResultWrapper
         * @since 1.18
         */
-       function fetchFromCache( $limit, $offset = false ) {
+       public function fetchFromCache( $limit, $offset = false ) {
                $dbr = wfGetDB( DB_SLAVE );
                $options = array();
                if ( $limit !== false ) {
@@ -487,7 +487,7 @@ abstract class QueryPage extends SpecialPage {
         * real, honest-to-gosh query page.
         * @param string $par
         */
-       function execute( $par ) {
+       public function execute( $par ) {
                $user = $this->getUser();
                if ( !$this->userCanExecute( $user ) ) {
                        $this->displayRestrictionError();