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
* @return array
* @since 1.18
*/
* @return array
* @since 1.18
*/
- function getQueryInfo() {
+ public function getQueryInfo() {
* @return bool
* @since 1.18
*/
* @return bool
* @since 1.18
*/
- function usesTimestamps() {
+ public function usesTimestamps() {
- function isExpensive() {
+ public function isExpensive() {
return $this->getConfig()->get( 'DisableQueryPages' );
}
return $this->getConfig()->get( 'DisableQueryPages' );
}
+ public function isCached() {
return $this->isExpensive() && $this->getConfig()->get( 'MiserMode' );
}
return $this->isExpensive() && $this->getConfig()->get( 'MiserMode' );
}
* @throws DBError|Exception
* @return bool|int
*/
* @throws DBError|Exception
* @return bool|int
*/
- function recache( $limit, $ignoreErrors = true ) {
+ public function recache( $limit, $ignoreErrors = true ) {
if ( !$this->isCacheable() ) {
return 0;
}
if ( !$this->isCacheable() ) {
return 0;
}
* @return ResultWrapper
* @since 1.18
*/
* @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();
$fname = get_class( $this ) . "::reallyDoQuery";
$dbr = $this->getRecacheDB();
$query = $this->getQueryInfo();
* @param int|bool $limit
* @return ResultWrapper
*/
* @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 {
if ( $this->isCached() && $this->isCacheable() ) {
return $this->fetchFromCache( $limit, $offset );
} else {
* @return ResultWrapper
* @since 1.18
*/
* @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 ) {
$dbr = wfGetDB( DB_SLAVE );
$options = array();
if ( $limit !== false ) {
* real, honest-to-gosh query page.
* @param string $par
*/
* 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();
$user = $this->getUser();
if ( !$this->userCanExecute( $user ) ) {
$this->displayRestrictionError();