http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89986

Revision: 89986
Author:   jeroendedauw
Date:     2011-06-13 18:10:43 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
style fixes

Modified Paths:
--------------
    trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
    trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php

Modified: trunk/extensions/SemanticResultFormats/Math/SRF_Math.php
===================================================================
--- trunk/extensions/SemanticResultFormats/Math/SRF_Math.php    2011-06-13 
18:07:24 UTC (rev 89985)
+++ trunk/extensions/SemanticResultFormats/Math/SRF_Math.php    2011-06-13 
18:10:43 UTC (rev 89986)
@@ -30,6 +30,7 @@
 
                while ( $row = $res->getNext() ) {
                        $last_col = array_pop( $row );
+                       
                        foreach ( $last_col->getContent() as $value ) {
                                // handle each value only if it's of type 
Number or NAry
                                if ( $value instanceof SMWNumberValue ) {
@@ -45,6 +46,7 @@
                                        // type Number, and use that; if none
                                        // are found, ignore this row
                                        $num = null;
+                                       
                                        foreach ( $inner_values as $inner_value 
) {
                                                if ( $inner_value instanceof 
SMWNumberValue ) {
                                                        if ( method_exists( 
$inner_value, 'getValueKey' ) ) {
@@ -56,12 +58,17 @@
                                                        break;
                                                }
                                        }
-                                       if ( is_null( $num ) )
+                                       
+                                       if ( is_null( $num ) ) {
                                                continue;
+                                       }
+                                               
                                } else {
                                        continue;
                                }
+                               
                                $count++;
+                               
                                if ( $this->mFormat == 'sum' || $this->mFormat 
== 'average' ) {
                                        $sum += $num;
                                } elseif ( $this->mFormat == 'min' ) {
@@ -93,9 +100,9 @@
                return $result;
        }
 
-        public function getParameters() {
-                return array(
-                        array( 'name' => 'limit', 'type' => 'int', 
'description' => wfMsg( 'srf_paramdesc_limit' ) ),
+       public function getParameters() {
+               return array(
+                       array( 'name' => 'limit', 'type' => 'int', 
'description' => wfMsg( 'srf_paramdesc_limit' ) ),
                );
        }
 

Modified: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
===================================================================
--- trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php    
2011-06-13 18:07:24 UTC (rev 89985)
+++ trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php    
2011-06-13 18:10:43 UTC (rev 89986)
@@ -99,8 +99,11 @@
                // no further results displayed ...
 
                // print footer
-               $result .= "</div>";
-               $this->isHTML = ( $outputmode == SMW_OUTPUT_HTML ); // yes, our 
code can be viewed as HTML if requested, no more parsing needed
+               $result .= '</div>';
+               
+               // yes, our code can be viewed as HTML if requested, no more 
parsing needed
+               $this->isHTML = $outputmode == SMW_OUTPUT_HTML;
+               
                return $result;
        }       
        
@@ -177,13 +180,18 @@
                                                $object, $outputmode, $pr, 
$first_col, $hastitle, $hastime,
                                                $first_value, $isEventline, 
$curmeta, $curdata, $date_value, $output, $positions
                                        );
+                                       
                                        if ( $event !== false ) {
                                                $events[] = $event;
                                        }
+                                       
                                        $first_value = false;
                                }
                                
-                               if ( $output ) $curdata .= '<br />';
+                               if ( $output ) {
+                                       $curdata .= '<br />';
+                               }
+                               
                                $output = false;
                                $first_col = false;
                        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to