dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always put type information before variable name for @var tags
[lhc/web/wiklou.git]
/
maintenance
/
checkSyntax.php
diff --git
a/maintenance/checkSyntax.php
b/maintenance/checkSyntax.php
index
998cade
..
3910f29
100644
(file)
--- a/
maintenance/checkSyntax.php
+++ b/
maintenance/checkSyntax.php
@@
-31,8
+31,8
@@
require_once __DIR__ . '/Maintenance.php';
class CheckSyntax extends Maintenance {
// List of files we're going to check
class CheckSyntax extends Maintenance {
// List of files we're going to check
- private $mFiles =
array(), $mFailures = array(), $mWarnings = array()
;
- private $mIgnorePaths =
array(), $mNoStyleCheckPaths = array()
;
+ private $mFiles =
[], $mFailures = [], $mWarnings = []
;
+ private $mIgnorePaths =
[], $mNoStyleCheckPaths = []
;
public function __construct() {
parent::__construct();
public function __construct() {
parent::__construct();
@@
-83,12
+83,10
@@
class CheckSyntax extends Maintenance {
private function buildFileList() {
global $IP;
private function buildFileList() {
global $IP;
- $this->mIgnorePaths = array(
- // Compat stuff, explodes on PHP 5.3
- "includes/NamespaceCompat.php$",
- );
+ $this->mIgnorePaths = [
+ ];
- $this->mNoStyleCheckPaths =
array(
+ $this->mNoStyleCheckPaths =
[
// Third-party code we don't care about
"/activemq_stomp/",
"EmailPage/PHPMailer",
// Third-party code we don't care about
"/activemq_stomp/",
"EmailPage/PHPMailer",
@@
-100,7
+98,7
@@
class CheckSyntax extends Maintenance {
"QPoll/Excel/",
"/geshi/",
"/smarty/",
"QPoll/Excel/",
"/geshi/",
"/smarty/",
-
)
;
+
]
;
if ( $this->hasOption( 'path' ) ) {
$path = $this->getOption( 'path' );
if ( $this->hasOption( 'path' ) ) {
$path = $this->getOption( 'path' );
@@
-141,13
+139,13
@@
class CheckSyntax extends Maintenance {
// Only check files in these directories.
// Don't just put $IP, because the recursive dir thingie goes into all subdirs
// Only check files in these directories.
// Don't just put $IP, because the recursive dir thingie goes into all subdirs
- $dirs =
array(
+ $dirs =
[
$IP . '/includes',
$IP . '/mw-config',
$IP . '/languages',
$IP . '/maintenance',
$IP . '/skins',
$IP . '/includes',
$IP . '/mw-config',
$IP . '/languages',
$IP . '/maintenance',
$IP . '/skins',
-
)
;
+
]
;
if ( $this->hasOption( 'with-extensions' ) ) {
$dirs[] = $IP . '/extensions';
}
if ( $this->hasOption( 'with-extensions' ) ) {
$dirs[] = $IP . '/extensions';
}
@@
-170,7
+168,6
@@
class CheckSyntax extends Maintenance {
* @return array Resulting list of changed files
*/
private function getGitModifiedFiles( $path ) {
* @return array Resulting list of changed files
*/
private function getGitModifiedFiles( $path ) {
-
global $wgMaxShellMemory;
if ( !is_dir( "$path/.git" ) ) {
global $wgMaxShellMemory;
if ( !is_dir( "$path/.git" ) ) {
@@
-205,7
+202,7
@@
class CheckSyntax extends Maintenance {
$wgMaxShellMemory = $oldMaxShellMemory;
$wgMaxShellMemory = $oldMaxShellMemory;
- $arr =
array()
;
+ $arr =
[]
;
$filename = strtok( $output, "\n" );
while ( $filename !== false ) {
if ( $filename !== '' ) {
$filename = strtok( $output, "\n" );
while ( $filename !== false ) {
if ( $filename !== '' ) {
@@
-229,7
+226,7
@@
class CheckSyntax extends Maintenance {
return false;
}
foreach ( $this->mIgnorePaths as $regex ) {
return false;
}
foreach ( $this->mIgnorePaths as $regex ) {
- $m =
array()
;
+ $m =
[]
;
if ( preg_match( "~{$regex}~", $file, $m ) ) {
return false;
}
if ( preg_match( "~{$regex}~", $file, $m ) ) {
return false;
}
@@
-308,7
+305,7
@@
class CheckSyntax extends Maintenance {
*/
private function checkForMistakes( $file ) {
foreach ( $this->mNoStyleCheckPaths as $regex ) {
*/
private function checkForMistakes( $file ) {
foreach ( $this->mNoStyleCheckPaths as $regex ) {
- $m =
array()
;
+ $m =
[]
;
if ( preg_match( "~{$regex}~", $file, $m ) ) {
return;
}
if ( preg_match( "~{$regex}~", $file, $m ) ) {
return;
}
@@
-329,7
+326,7
@@
class CheckSyntax extends Maintenance {
}
if ( !isset( $this->mWarnings[$file] ) ) {
}
if ( !isset( $this->mWarnings[$file] ) ) {
- $this->mWarnings[$file] =
array()
;
+ $this->mWarnings[$file] =
[]
;
}
$this->mWarnings[$file][] = $desc;
$this->output( "Warning in file $file: $desc found.\n" );
}
$this->mWarnings[$file][] = $desc;
$this->output( "Warning in file $file: $desc found.\n" );
@@
-341,7
+338,7
@@
class CheckSyntax extends Maintenance {
}
if ( !isset( $this->mWarnings[$file] ) ) {
}
if ( !isset( $this->mWarnings[$file] ) ) {
- $this->mWarnings[$file] =
array()
;
+ $this->mWarnings[$file] =
[]
;
}
$this->mWarnings[$file][] = $desc;
$this->output( "Warning in file $file: $desc found.\n" );
}
$this->mWarnings[$file][] = $desc;
$this->output( "Warning in file $file: $desc found.\n" );