r63747 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63746‎ | r63747 | r63748 >
Date:18:01, 14 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Stylized with Stylize.php to conform with MW's spacing conventions
Modified paths:
  • /trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php
@@ -24,7 +24,7 @@
2525 for ( $i = 0; $i < strlen( $param ); $i++ ) {
2626 $c = $param[$i];
2727 if ( ( $c == ';' ) && ( $uncompleted_square_brackets <= 0 ) ) {
28 - $sub_params[] = trim($sub_param);
 28+ $sub_params[] = trim( $sub_param );
2929 $sub_param = "";
3030 } else {
3131 $sub_param .= $c;
@@ -34,7 +34,7 @@
3535 $uncompleted_square_brackets--;
3636 }
3737 }
38 - $sub_params[] = trim($sub_param);
 38+ $sub_params[] = trim( $sub_param );
3939 return $sub_params;
4040 }
4141
@@ -56,8 +56,8 @@
5757 if ( strpos( $param, '[' ) !== false ) {
5858 $sub_params = SCQQueryProcessor::getSubParams( $param );
5959 $next_result = SCQQueryProcessor::getQueryResultFromFunctionParams( $sub_params, SMW_OUTPUT_WIKI );
60 - if (method_exists($next_result, 'getResults')) { // SMW 1.5+
61 - $results = self::mergeSMWQueryResults($results, $next_result->getResults());
 60+ if ( method_exists( $next_result, 'getResults' ) ) { // SMW 1.5+
 61+ $results = self::mergeSMWQueryResults( $results, $next_result->getResults() );
6262 } else {
6363 if ( $query_result == null )
6464 $query_result = new SCQQueryResult( $next_result->getPrintRequests(), new SMWQuery() );
@@ -70,7 +70,7 @@
7171 }
7272 }
7373 }
74 - if ( is_null($query_result) ) // SMW 1.5+
 74+ if ( is_null( $query_result ) ) // SMW 1.5+
7575 $query_result = new SCQQueryResult( $next_result->getPrintRequests(), new SMWQuery(), $results, smwfGetStore() );
7676 $result = SCQQueryProcessor::getResultFromQueryResult( $query_result, $other_params, null, SMW_OUTPUT_WIKI );
7777 } else {
@@ -93,12 +93,12 @@
9494 return $result2;
9595 }
9696 $existing_page_names = array();
97 - foreach ($result1 as $r1) {
 97+ foreach ( $result1 as $r1 ) {
9898 $existing_page_names[] = $r1->getWikiValue();
9999 }
100 - foreach ($result2 as $r2) {
 100+ foreach ( $result2 as $r2 ) {
101101 $page_name = $r2->getWikiValue();
102 - if (! in_array($page_name, $existing_page_names)) {
 102+ if ( ! in_array( $page_name, $existing_page_names ) ) {
103103 $result1[] = $r2;
104104 }
105105 }
@@ -138,8 +138,8 @@
139139 } else {
140140 $display_options[$key] = $value;
141141 }
142 - if ( method_exists($query_result, 'getResults') ) { // SMW 1.5+
143 - foreach ($query_result->getResults() as $wiki_page) {
 142+ if ( method_exists( $query_result, 'getResults' ) ) { // SMW 1.5+
 143+ foreach ( $query_result->getResults() as $wiki_page ) {
144144 $wiki_page->display_options = $display_options;
145145 }
146146 } else {

Status & tagging log