From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/ConfEditor.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'includes/ConfEditor.php') diff --git a/includes/ConfEditor.php b/includes/ConfEditor.php index f862ebb7..b08b77df 100644 --- a/includes/ConfEditor.php +++ b/includes/ConfEditor.php @@ -72,7 +72,7 @@ class ConfEditor { var $pathInfo; /** - * Next serial number for whitespace placeholder paths (@extra-N) + * Next serial number for whitespace placeholder paths (\@extra-N) */ var $serial; @@ -104,7 +104,7 @@ class ConfEditor { /** * Edit the text. Returns the edited text. - * @param array $ops Array of operations. + * @param $ops Array of operations. * * Operations are given as an associative array, with members: * type: One of delete, set, append or insert (required) @@ -176,7 +176,7 @@ class ConfEditor { // Has it got a comma already? if ( strpos( $lastEltPath, '@extra' ) === false && !$lastEltInfo['hasComma'] ) { // No comma, insert one after the value region - list( $start, $end ) = $this->findValueRegion( $lastEltPath ); + list( , $end ) = $this->findValueRegion( $lastEltPath ); $this->replaceSourceRegion( $end - 1, $end - 1, ',' ); } @@ -184,7 +184,7 @@ class ConfEditor { list( $start, $end ) = $this->findDeletionRegion( $lastEltPath ); if ( $key === null ) { - list( $indent, $arrowIndent ) = $this->getIndent( $start ); + list( $indent, ) = $this->getIndent( $start ); $textToInsert = "$indent$value,"; } else { list( $indent, $arrowIndent ) = @@ -202,12 +202,12 @@ class ConfEditor { if ( $firstEltPath === false ) { throw new MWException( "Can't find array element of \"$path\"" ); } - list( $start, $end ) = $this->findDeletionRegion( $firstEltPath ); + list( $start, ) = $this->findDeletionRegion( $firstEltPath ); $info = $this->pathInfo[$firstEltPath]; // Make the text to insert if ( $key === null ) { - list( $indent, $arrowIndent ) = $this->getIndent( $start ); + list( $indent, ) = $this->getIndent( $start ); $textToInsert = "$indent$value,"; } else { list( $indent, $arrowIndent ) = @@ -336,7 +336,7 @@ class ConfEditor { // Split all copy operations with a source corresponding to the region // in question. $newEdits = array(); - foreach ( $this->edits as $i => $edit ) { + foreach ( $this->edits as $edit ) { if ( $edit[0] !== 'copy' ) { $newEdits[] = $edit; continue; @@ -427,7 +427,7 @@ class ConfEditor { */ function findValueRegion( $pathName ) { if ( !isset( $this->pathInfo[$pathName] ) ) { - throw new MWEXception( "Can't find path \"$pathName\"" ); + throw new MWException( "Can't find path \"$pathName\"" ); } $path = $this->pathInfo[$pathName]; if ( $path['valueStartByte'] === false || $path['valueEndByte'] === false ) { @@ -438,7 +438,7 @@ class ConfEditor { /** * Find the path name of the last element in the array. - * If the array is empty, this will return the @extra interstitial element. + * If the array is empty, this will return the \@extra interstitial element. * If the specified path is not found or is not an array, it will return false. */ function findLastArrayElement( $path ) { @@ -474,7 +474,7 @@ class ConfEditor { /* * Find the path name of first element in the array. - * If the array is empty, this will return the @extra interstitial element. + * If the array is empty, this will return the \@extra interstitial element. * If the specified path is not found or is not an array, it will return false. */ function findFirstArrayElement( $path ) { @@ -510,7 +510,6 @@ class ConfEditor { $indent = false; } if ( $indent !== false && $arrowPos !== false ) { - $textToInsert = "$indent$key "; $arrowIndentLength = $arrowPos - $pos - $indentLength - strlen( $key ); if ( $arrowIndentLength > 0 ) { $arrowIndent = str_repeat( ' ', $arrowIndentLength ); @@ -537,7 +536,7 @@ class ConfEditor { switch ( $state ) { case 'file': - $token = $this->expect( T_OPEN_TAG ); + $this->expect( T_OPEN_TAG ); $token = $this->skipSpace(); if ( $token->isEnd() ) { break 2; @@ -836,7 +835,6 @@ class ConfEditor { * not call except from popPath() or nextPath(). */ function endPath() { - $i = count( $this->pathStack ) - 1; $key = ''; foreach ( $this->pathStack as $pathInfo ) { if ( $key !== '' ) { @@ -878,7 +876,7 @@ class ConfEditor { /** * Go to the next path on the same level. This ends the current path and - * starts a new one. If $path is @next, the new path is set to the next + * starts a new one. If $path is \@next, the new path is set to the next * numeric array element. */ function nextPath( $path ) { -- cgit v1.2.2