From: Antoine Musso Date: Tue, 12 Feb 2013 21:32:09 +0000 (+0100) Subject: phpcs: Normalize methods declarations to "[final abstract] [visibility]". X-Git-Tag: 1.31.0-rc.0~20649^2 X-Git-Url: http://git.cyclocoop.org/%27.generer_url_ecrire%28%27admin_couteau_suisse%27%2C%27cmd=descrip&outil=boites_privees?a=commitdiff_plain;h=6c35b02aa741542dc8505cff1aefc6ffa2454838;p=lhc%2Fweb%2Fwiklou.git phpcs: Normalize methods declarations to "[final abstract] [visibility]". CodeSniffer sniff is: [abstract final] [] [static] function As declared by: PSR2.Methods.MethodDeclaration.StaticBeforeVisibility in: https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml Change-Id: Ifabd289e8668019ed752bdd711b3b43a9c346336 --- diff --git a/includes/externalstore/ExternalStoreMedium.php b/includes/externalstore/ExternalStoreMedium.php index 99d5fc3ca2..34e43e25df 100644 --- a/includes/externalstore/ExternalStoreMedium.php +++ b/includes/externalstore/ExternalStoreMedium.php @@ -46,7 +46,7 @@ abstract class ExternalStoreMedium { * @return string|bool The text stored or false on error * @throws MWException */ - public abstract function fetchFromURL( $url ); + abstract public function fetchFromURL( $url ); /** * Insert a data item into a given location @@ -56,5 +56,5 @@ abstract class ExternalStoreMedium { * @return string|bool The URL of the stored data item, or false on error * @throws MWException */ - public abstract function store( $location, $data ); + abstract public function store( $location, $data ); } diff --git a/maintenance/deleteArchivedFiles.inc b/maintenance/deleteArchivedFiles.inc index cc0970367b..792ee6c69f 100644 --- a/maintenance/deleteArchivedFiles.inc +++ b/maintenance/deleteArchivedFiles.inc @@ -27,7 +27,7 @@ * @ingroup Maintenance */ class DeleteArchivedFilesImplementation { - static public function doDelete( $output, $force ) { + public static function doDelete( $output, $force ) { # Data should come off the master, wrapped in a transaction $dbw = wfGetDB( DB_MASTER ); $dbw->begin( __METHOD__ ); diff --git a/maintenance/deleteArchivedRevisions.inc b/maintenance/deleteArchivedRevisions.inc index 414d41adb6..dd8e3dd473 100644 --- a/maintenance/deleteArchivedRevisions.inc +++ b/maintenance/deleteArchivedRevisions.inc @@ -36,7 +36,7 @@ class DeleteArchivedRevisionsImplementation { * purgeRedundantText(). See Maintenance for a description of * those methods. */ - static public function doDelete( $maint ) { + public static function doDelete( $maint ) { $dbw = wfGetDB( DB_MASTER ); $dbw->begin( __METHOD__ ); diff --git a/maintenance/fuzz-tester.php b/maintenance/fuzz-tester.php index 445a3fb97a..6bb44a17a1 100644 --- a/maintenance/fuzz-tester.php +++ b/maintenance/fuzz-tester.php @@ -747,7 +747,7 @@ class wikiFuzz { /** ** Randomly returns one element of the input array. */ - static public function chooseInput( array $input ) { + public static function chooseInput( array $input ) { $randindex = wikiFuzz::randnum( count( $input ) - 1 ); return $input[$randindex]; } @@ -761,7 +761,7 @@ class wikiFuzz { * @param $start int * @return int */ - static public function randnum( $finish, $start = 0 ) { + public static function randnum( $finish, $start = 0 ) { return mt_rand( $start, $finish ); } @@ -769,7 +769,7 @@ class wikiFuzz { * Returns a mix of random text and random wiki syntax. * @return string */ - static private function randstring() { + private static function randstring() { $thestring = ""; for ( $i = 0; $i < 40; $i++ ) { @@ -801,7 +801,7 @@ class wikiFuzz { * or random data from "other". * @return string */ - static private function makestring() { + private static function makestring() { $what = wikiFuzz::randnum( 2 ); if ( $what == 0 ) { return wikiFuzz::randstring(); @@ -818,7 +818,7 @@ class wikiFuzz { * @param $matches * @return string */ - static private function stringEscape( $matches ) { + private static function stringEscape( $matches ) { return sprintf( "\\x%02x", ord( $matches[1] ) ); } @@ -828,7 +828,7 @@ class wikiFuzz { * @param $str string * @return string */ - static public function makeTitleSafe( $str ) { + public static function makeTitleSafe( $str ) { $legalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF"; return preg_replace_callback( "/([^$legalTitleChars])/", 'wikiFuzz::stringEscape', @@ -839,7 +839,7 @@ class wikiFuzz { ** Returns a string of fuzz text. * @return string */ - static private function loop() { + private static function loop() { switch ( wikiFuzz::randnum( 3 ) ) { case 1: // an opening tag, with parameters. $string = ""; @@ -868,7 +868,7 @@ class wikiFuzz { * Returns one of the three styles of random quote: ', ", and nothing. * @return string */ - static private function getRandQuote() { + private static function getRandQuote() { switch ( wikiFuzz::randnum( 3 ) ) { case 1 : return "'"; case 2 : return "\""; @@ -881,7 +881,7 @@ class wikiFuzz { * @param $maxtypes int * @return string */ - static public function makeFuzz( $maxtypes = 2 ) { + public static function makeFuzz( $maxtypes = 2 ) { $page = ""; for ( $k = 0; $k < $maxtypes; $k++ ) { $page .= wikiFuzz::loop(); diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 05a6f15426..6b56dcf585 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -227,7 +227,7 @@ class ParserTest { * Remove last character if it is a newline * @group utility */ - static public function chomp( $s ) { + public static function chomp( $s ) { if ( substr( $s, -1 ) === "\n" ) { return substr( $s, 0, -1 ); } @@ -1195,7 +1195,7 @@ class ParserTest { * @param $line Integer: the input line number, for reporting errors * @param $ignoreDuplicate Boolean: whether to silently ignore duplicate pages */ - static public function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) { + public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) { global $wgCapitalLinks; $oldCapitalLinks = $wgCapitalLinks; diff --git a/tests/selenium/Selenium.php b/tests/selenium/Selenium.php index ecf7f9ec94..0cd50fef8b 100644 --- a/tests/selenium/Selenium.php +++ b/tests/selenium/Selenium.php @@ -106,7 +106,7 @@ class Selenium { self::$url = $url; } - static public function getUrl() { + public static function getUrl() { return self::$url; } diff --git a/tests/selenium/SeleniumTestSuite.php b/tests/selenium/SeleniumTestSuite.php index 81a630f8ae..eb5f1198fb 100644 --- a/tests/selenium/SeleniumTestSuite.php +++ b/tests/selenium/SeleniumTestSuite.php @@ -11,7 +11,7 @@ abstract class SeleniumTestSuite extends PHPUnit_Framework_TestSuite { const RESULT_OK = 2; const RESULT_ERROR = 3; - public abstract function addTests(); + abstract public function addTests(); public function setUp() { // Hack because because PHPUnit version 3.0.6 which is on prototype does not