Add failing test for bug 14404.
[lhc/web/wiklou.git] / includes / ConfEditor.php
index 4bd55ac..b08b77d 100644 (file)
@@ -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 ) = 
@@ -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;