EBernhardson (WMF) has submitted this change and it was merged. Change subject: Coding standards cleanup ......................................................................
Coding standards cleanup Change-Id: Id2c191c6e7eeeb0063048c4e972499e2ab528d01 --- M includes/Block/Topic.php M includes/Data/ObjectManager.php M includes/WorkflowLoader.php M includes/api/ApiQueryFlow.php M special/SpecialFlow.php M templates/summary.html.php 6 files changed, 18 insertions(+), 18 deletions(-) Approvals: EBernhardson (WMF): Verified; Looks good to me, approved diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php index a8abc80..24ff775 100644 --- a/includes/Block/Topic.php +++ b/includes/Block/Topic.php @@ -414,7 +414,7 @@ $children[] = $this->renderPostAPI( $templating, $child, $options ); } - if ( count($children) > 1 ) { + if ( count( $children ) > 1 ) { $output['replies'] = $children; } } @@ -480,7 +480,7 @@ } } - if ( count($searchConditions) === 0 ) { + if ( count( $searchConditions ) === 0 ) { return array(); } diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index 04cd787..8ac2e5b 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -517,7 +517,7 @@ foreach( $sortFields as $field ) { $value = $row[$field]; - if ( strlen($value) == 16 && preg_match( '/_id$/', $field ) ) { + if ( strlen( $value ) == 16 && preg_match( '/_id$/', $field ) ) { $value = UUID::create( $value )->getHex(); } $offsetFields[] = $value; @@ -929,7 +929,7 @@ foreach( $attributes as $key => $attr ) { if ( $attr instanceof \Flow\Model\UUID ) { $attributes[$key] = $attr->getHex(); - } elseif ( strlen($attr) == 16 && preg_match( '/_id$/', $key ) ) { + } elseif ( strlen( $attr ) == 16 && preg_match( '/_id$/', $key ) ) { $uuid = new \Flow\Model\UUID( $attr ); $attributes[$key] = $uuid->getHex(); } diff --git a/includes/WorkflowLoader.php b/includes/WorkflowLoader.php index d4c3bb7..5c7fc77 100644 --- a/includes/WorkflowLoader.php +++ b/includes/WorkflowLoader.php @@ -29,7 +29,7 @@ throw new \MWException( 'Interwiki not implemented yet' ); } if ( $pageTitle && $pageTitle->getArticleID() === 0 ) { - throw new \MWException( 'Can only load workflows for existing page. Page '.($pageTitle->getPrefixedText()). ' does not exist.' ); + throw new \MWException( 'Can only load workflows for existing page. Page '.( $pageTitle->getPrefixedText() ). ' does not exist.' ); } $this->storage = $storage; @@ -63,7 +63,7 @@ protected function loadWorkflow( \Title $title ) { global $wgContLang, $wgUser; - $storage = $this->storage->getStorage('Workflow'); + $storage = $this->storage->getStorage( 'Workflow'); $definition = $this->loadDefinition(); if ( !$definition->getOption( 'unique' ) ) { @@ -84,7 +84,7 @@ } protected function loadWorkflowById( /* Title or false */ $title, $workflowId ) { - $workflow = $this->storage->getStorage('Workflow')->get( $workflowId ); + $workflow = $this->storage->getStorage( 'Workflow' )->get( $workflowId ); if ( !$workflow ) { throw new \MWException( 'Invalid workflow requested by id' ); } @@ -92,7 +92,7 @@ // todo: redirect? throw new \MWException( 'Flow workflow is for different page' ); } - $definition = $this->storage->getStorage('Definition')->get( $workflow->getDefinitionId() ); + $definition = $this->storage->getStorage( 'Definition' )->get( $workflow->getDefinitionId() ); if ( !$definition ) { throw new \MWException( 'Flow workflow references unknown definition id: ' . $workflow->getDefinitionId()->getHex() ); } @@ -103,7 +103,7 @@ protected function loadDefinition() { global $wgFlowDefaultWorkflow; - $repo = $this->storage->getStorage('Definition'); + $repo = $this->storage->getStorage( 'Definition' ); $id = $this->definitionRequest; if ( $id instanceof UUID ) { $definition = $repo->get( $id ); @@ -171,7 +171,7 @@ } public function commit( Workflow $workflow, array $blocks ) { - $this->storage->getStorage('Workflow')->put( $workflow ); + $this->storage->getStorage( 'Workflow' )->put( $workflow ); $results = array(); foreach ( $blocks as $block ) { $results[$block->getName()] = $block->commit(); @@ -199,4 +199,4 @@ $this->rootPostLoader ); } -} \ No newline at end of file +} diff --git a/includes/api/ApiQueryFlow.php b/includes/api/ApiQueryFlow.php index a802012..d557ee4 100644 --- a/includes/api/ApiQueryFlow.php +++ b/includes/api/ApiQueryFlow.php @@ -28,7 +28,7 @@ $block->init( $params['action'], $this->getContext()->getUser() ); $blockParams = array(); - if ( isset($passedParams[$block->getName()]) ) { + if ( isset( $passedParams[$block->getName()] ) ) { $blockParams = $passedParams[$block->getName()]; } diff --git a/special/SpecialFlow.php b/special/SpecialFlow.php index 07cec02..26db9f7 100644 --- a/special/SpecialFlow.php +++ b/special/SpecialFlow.php @@ -24,8 +24,8 @@ public function execute( $subPage ) { $this->setHeaders(); - $this->getOutput()->addModules( array('ext.flow.base') ); - + $this->getOutput()->addModules( array( 'ext.flow.base' ) ); + if ( empty( $subPage ) ) { // If no specific article was requested, render the users flow throw new \MWException( 'TODO: Redirect to users board?' ); @@ -60,8 +60,8 @@ if ( $request->getMethod() === 'POST' ) { $user = $this->container['user']; - if ( $request->getVal('wpEditToken') != $user->getEditToken('flow') ) { - $error = '<div class="error">' . wfMessage('sessionfailure') . '</div>'; + if ( $request->getVal( 'wpEditToken' ) != $user->getEditToken( 'flow' ) ) { + $error = '<div class="error">' . wfMessage( 'sessionfailure' ) . '</div>'; $this->getOutput()->addHTML( $error ); } else { $user = $this->container['user']; @@ -98,7 +98,7 @@ return $container; } - + protected function loadTitle( $text ) { $title = Title::newFromText( $text ); if ( $title === null ) { diff --git a/templates/summary.html.php b/templates/summary.html.php index 66f052c..986a5be 100644 --- a/templates/summary.html.php +++ b/templates/summary.html.php @@ -10,4 +10,4 @@ $editLink = $this->generateUrl( $workflow, 'edit-summary' ); ?> -<div class="flow-summary-edit-link"><a href="<?php echo htmlspecialchars($editLink);?>"><?php echo wfMessage( 'flow-edit-summary-link' )->escaped()?></a></div> +<div class="flow-summary-edit-link"><a href="<?php echo htmlspecialchars( $editLink );?>"><?php echo wfMessage( 'flow-edit-summary-link' )->escaped()?></a></div> -- To view, visit https://gerrit.wikimedia.org/r/82432 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2c191c6e7eeeb0063048c4e972499e2ab528d01 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: EBernhardson (WMF) <ebernhard...@wikimedia.org> Gerrit-Reviewer: EBernhardson (WMF) <ebernhard...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits