phpcs fixups for line length
authorAdam Roses Wight <awight@wikimedia.org>
Sat, 14 Mar 2015 08:35:54 +0000 (01:35 -0700)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 14 Mar 2015 11:05:41 +0000 (11:05 +0000)
Change-Id: Ic36b111dcae0880fb34fb336065098650a30db5f

includes/api/ApiEditPage.php
tests/phpunit/includes/EditPageTest.php

index 15fa333..f697b6f 100644 (file)
@@ -48,8 +48,12 @@ class ApiEditPage extends ApiBase {
                $apiResult = $this->getResult();
 
                if ( $params['redirect'] ) {
-                       if ( $params['prependtext'] === null && $params['appendtext'] === null && $params['section'] !== 'new' ) {
-                               $this->dieUsage( 'You have attempted to edit using the "redirect"-following mode, which must be used in conjuction with section=new, prependtext, or appendtext.', 'redirect-appendonly' );
+                       if ( $params['prependtext'] === null && $params['appendtext'] === null
+                               && $params['section'] !== 'new'
+                       ) {
+                               $this->dieUsage( 'You have attempted to edit using the "redirect"-following'
+                                       . ' mode, which must be used in conjuction with section=new, prependtext'
+                                       . ', or appendtext.', 'redirect-appendonly' );
                        }
                        if ( $titleObj->isRedirect() ) {
                                $oldTitle = $titleObj;
@@ -296,10 +300,13 @@ class ApiEditPage extends ApiBase {
                if ( !is_null( $params['section'] ) ) {
                        $section = $params['section'];
                        if ( !preg_match( '/^((T-)?\d+|new)$/', $section ) ) {
-                               $this->dieUsage( "The section parameter must be a valid section id or 'new'", "invalidsection" );
+                               $this->dieUsage( "The section parameter must be a valid section id or 'new'",
+                                       "invalidsection" );
                        }
                        $content = $pageObj->getContent();
-                       if ( $section !== '0' && $section != 'new' && ( !$content || !$content->getSection( $section ) ) ) {
+                       if ( $section !== '0' && $section != 'new'
+                               && ( !$content || !$content->getSection( $section ) )
+                       ) {
                                $this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
                        }
                        $requestArray['wpSection'] = $params['section'];
index 702fce4..15778e4 100644 (file)
@@ -217,7 +217,8 @@ class EditPageTest extends MediaWikiLangTestCase {
                                EditPage::AS_SUCCESS_NEW_ARTICLE,
                                ''
                        ),
-                       array( 'expected registered MediaWiki: page whose default content is empty not being created if empty',
+                       array( 'expected registered MediaWiki: page whose default content is empty'
+                                       . ' not being created if empty',
                                'MediaWiki:Ipb-default-expiry',
                                'UTSysop',
                                '',
@@ -246,7 +247,9 @@ class EditPageTest extends MediaWikiLangTestCase {
         * @dataProvider provideCreatePages
         * @covers EditPage
         */
-       public function testCreatePage( $desc, $pageTitle, $user, $editText, $expectedCode, $expectedText, $ignoreBlank = false ) {
+       public function testCreatePage(
+               $desc, $pageTitle, $user, $editText, $expectedCode, $expectedText, $ignoreBlank = false
+       ) {
                $edit = array( 'wpTextbox1' => $editText );
                if ( $ignoreBlank ) {
                        $edit['wpIgnoreBlankArticle'] = 1;