API: fix copyright symbol, coding style cleanup, more braces
[lhc/web/wiklou.git] / includes / api / ApiPurge.php
index 6bcecc7..5c83d34 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 
-/*
+/**
  * Created on Sep 2, 2008
  *
  * API for MediaWiki 1.14+
  *
- * Copyright (C) 2008 Chad Horohoe
+ * Copyright © 2008 Chad Horohoe
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
-       require_once ( 'ApiBase.php' );
+       require_once( 'ApiBase.php' );
 }
 
 /**
@@ -34,7 +34,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 class ApiPurge extends ApiBase {
 
        public function __construct( $main, $action ) {
-               parent :: __construct( $main, $action );
+               parent::__construct( $main, $action );
        }
 
        /**
@@ -43,24 +43,24 @@ class ApiPurge extends ApiBase {
        public function execute() {
                global $wgUser;
                $params = $this->extractRequestParams();
-               if ( !$wgUser->isAllowed( 'purge' ) )
+               if ( !$wgUser->isAllowed( 'purge' ) ) {
                        $this->dieUsageMsg( array( 'cantpurge' ) );
-               if ( !isset( $params['titles'] ) )
+               }
+               if ( !isset( $params['titles'] ) ) {
                        $this->dieUsageMsg( array( 'missingparam', 'titles' ) );
+               }
                $result = array();
                foreach ( $params['titles'] as $t ) {
                        $r = array();
                        $title = Title::newFromText( $t );
-                       if ( !$title instanceof Title )
-                       {
+                       if ( !$title instanceof Title ) {
                                $r['title'] = $t;
                                $r['invalid'] = '';
                                $result[] = $r;
                                continue;
                        }
                        ApiQueryBase::addTitleInfo( $r, $title );
-                       if ( !$title->exists() )
-                       {
+                       if ( !$title->exists() ) {
                                $r['missing'] = '';
                                $result[] = $r;
                                continue;
@@ -84,30 +84,30 @@ class ApiPurge extends ApiBase {
        }
 
        public function getAllowedParams() {
-               return array (
+               return array(
                        'titles' => array(
-                               ApiBase :: PARAM_ISMULTI => true
+                               ApiBase::PARAM_ISMULTI => true
                        )
                );
        }
 
        public function getParamDescription() {
-               return array (
+               return array(
                        'titles' => 'A list of titles',
                );
        }
 
        public function getDescription() {
-               return array (
+               return array(
                        'Purge the cache for the given titles.'
                );
        }
-       
-    public function getPossibleErrors() {
+
+       public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'cantpurge' ),
                        array( 'missingparam', 'titles' ),
-        ) );
+               ) );
        }
 
        protected function getExamples() {