r80925 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80924‎ | r80925 | r80926 >
Date:21:56, 24 January 2011
Author:reedy
Status:deferred
Tags:
Comment:
Remove duplicately overwritten variable (static method and constructor)

Output $out when we're doing an early return
Modified paths:
  • /trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaProject.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaInstance.php
@@ -412,8 +412,9 @@
413413
414414 $sk = $wgUser->getSkin();
415415 $domain = OpenStackNovaDomain::getDomainByName( $formData['domain'] );
416 - if ( ! $domain ) {
 416+ if ( !$domain ) {
417417 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-invaliddomain' ) );
 418+ $wgOut->addHtml( $out );
418419 return true;
419420 }
420421 $instance = $this->userNova->createInstance( $formData['instancename'], $formData['imageType'], '', $formData['instanceType'], $formData['availabilityZone'], $formData['groups'] );
@@ -461,6 +462,7 @@
462463 $instance = $this->adminNova->getInstance( $formData['instanceid'] );
463464 if ( ! $instance ) {
464465 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistanthost' ) );
 466+ $wgOut->addHtml( $out );
465467 return true;
466468 }
467469 $instancename = $instance->getInstanceName();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -462,6 +462,7 @@
463463 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
464464 if ( ! $securitygroup ) {
465465 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) );
 466+ $wgOut->addHtml( $out );
466467 return true;
467468 }
468469 $groupname = $securitygroup->getGroupName();
@@ -525,6 +526,7 @@
526527 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
527528 if ( ! $securitygroup ) {
528529 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) );
 530+ $wgOut->addHtml( $out );
529531 return false;
530532 }
531533 $groupname = $securitygroup->getGroupName();
@@ -567,6 +569,7 @@
568570 $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
569571 if ( ! $securitygroup ) {
570572 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistantsecuritygroup' ) );
 573+ $wgOut->addHtml( $out );
571574 return false;
572575 }
573576 $groupname = $securitygroup->getGroupName();
Index: trunk/extensions/OpenStackManager/special/SpecialNovaProject.php
@@ -299,8 +299,7 @@
300300 function tryDeleteMemberSubmit( $formData, $entryPoint = 'internal' ) {
301301 global $wgOut, $wgUser;
302302
303 - $project = new OpenStackNovaProject( $formData['projectname'] );
304 - $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] );
 303+ $project = OpenStackNovaProject::getProjectByName( $formData['projectname'] );
305304 if ( ! $project ) {
306305 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-nonexistentproject' ) );
307306 $wgOut->addHTML( $out );

Status & tagging log