Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUI.php |
— | — | @@ -387,7 +387,7 @@ |
388 | 388 | // processing params for main result column |
389 | 389 | if ( is_array( $mainColumnLabels ) ) { |
390 | 390 | foreach ( $mainColumnLabels as $key => $label ) { |
391 | | - if ( $label == '' ) { |
| 391 | + if ( $label === '' ) { |
392 | 392 | $po[$key] = "?"; |
393 | 393 | } else { |
394 | 394 | $po[$key] = "? = $label"; |
— | — | @@ -398,7 +398,7 @@ |
399 | 399 | $categoryNamespace = $wgContLang->getNsText( NS_CATEGORY ); |
400 | 400 | if ( is_array( $categoryValues ) ) { |
401 | 401 | foreach ( $categoryValues as $key => $value ) { |
402 | | - if ( trim( $value ) == '' ) { |
| 402 | + if ( trim( $value ) === '' ) { |
403 | 403 | $po[$key] = "?$categoryNamespace" ; |
404 | 404 | } else { |
405 | 405 | $po[$key] = "?$categoryNamespace:$value"; |
— | — | @@ -429,7 +429,7 @@ |
430 | 430 | $params['order'] = ''; |
431 | 431 | foreach ( $propertyValues as $key => $propertyValue ) { |
432 | 432 | $propertyValues[$key] = trim( $propertyValue ); |
433 | | - if ( $propertyValues[$key] == '' ) { |
| 433 | + if ( $propertyValues[$key] === '' ) { |
434 | 434 | unset( $propertyValues[$key] ); |
435 | 435 | } |
436 | 436 | if ( $smwgQSortingSupport |
— | — | @@ -441,10 +441,10 @@ |
442 | 442 | $params['order'] .= ( $params['order'] != '' ? ',':'' ) . $orderValues[$key]; |
443 | 443 | } |
444 | 444 | } |
445 | | - if ( $params['sort'] == '' ) { |
| 445 | + if ( $params['sort'] === '' ) { |
446 | 446 | unset ( $params['sort'] ); |
447 | 447 | } |
448 | | - if ( $params['order'] == '' ) { |
| 448 | + if ( $params['order'] === '' ) { |
449 | 449 | unset ( $params['order'] ); |
450 | 450 | } |
451 | 451 | $displayValues = $wgRequest->getArray( 'display' ); |
— | — | @@ -848,7 +848,7 @@ |
849 | 849 | ) . |
850 | 850 | Xml::closeElement( 'div' ); |
851 | 851 | $urlArgs["category[$i]"] = |
852 | | - ( $categoryValues[$key] == '' ) ? ' ':$categoryValues[$key]; |
| 852 | + ( $categoryValues[$key] === '' ) ? ' ':$categoryValues[$key]; |
853 | 853 | |
854 | 854 | $urlArgs["cat_label[$i]"] = $categoryLabelValues[$key]; |
855 | 855 | $urlArgs["cat_yes[$i]"] = $categoryYesValues[$key]; |
— | — | @@ -879,7 +879,7 @@ |
880 | 880 | '<a class="smwq-more" href="javascript:smw_makeQueryMatchesDialog(\'' . $i . '\')">' . wfMsg( 'smw_qui_options' ) . '</a> ' . |
881 | 881 | '</div>'; |
882 | 882 | $urlArgs["maincol_label[$i]"] = |
883 | | - ( $mainColumnLabels[$key] == '' ) ? ' ':$mainColumnLabels[$key]; |
| 883 | + ( $mainColumnLabels[$key] === '' ) ? ' ':$mainColumnLabels[$key]; |
884 | 884 | $i++; |
885 | 885 | } |
886 | 886 | } |
— | — | @@ -1538,7 +1538,7 @@ |
1539 | 1539 | if ( is_array( $orderValues ) ) { |
1540 | 1540 | $params['order'] = ''; |
1541 | 1541 | foreach ( $orderValues as $order_value ) { |
1542 | | - if ( $order_value == '' ) { |
| 1542 | + if ( $order_value === '' ) { |
1543 | 1543 | $order_value = 'ASC'; |
1544 | 1544 | } |
1545 | 1545 | $params['order'] .= ( $params['order'] != '' ? ',' : '' ) . $order_value; |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | |
210 | 210 | $errors = array(); |
211 | 211 | if ( $enableValidation ) { |
212 | | - if ( $queryString == '' ) { |
| 212 | + if ( $queryString === '' ) { |
213 | 213 | $errors[] = wfMsg( 'smw_qui_noquery' ); |
214 | 214 | } else { |
215 | 215 | $query = SMWQueryProcessor::createQuery( $queryString, array() ); |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | $this->m_params['order'] = ''; |
132 | 132 | |
133 | 133 | foreach ( $order_values as $order_value ) { |
134 | | - if ( $order_value == '' ) $order_value = 'ASC'; |
| 134 | + if ( $order_value === '' ) $order_value = 'ASC'; |
135 | 135 | $this->m_params['order'] .= ( $this->m_params['order'] != '' ? ',' : '' ) . $order_value; |
136 | 136 | } |
137 | 137 | } |
— | — | @@ -148,20 +148,20 @@ |
149 | 149 | |
150 | 150 | if ( !array_key_exists( 'offset', $this->m_params ) ) { |
151 | 151 | $this->m_params['offset'] = $wgRequest->getVal( 'offset' ); |
152 | | - if ( $this->m_params['offset'] == '' ) $this->m_params['offset'] = 0; |
| 152 | + if ( $this->m_params['offset'] === '' ) $this->m_params['offset'] = 0; |
153 | 153 | } |
154 | 154 | |
155 | 155 | if ( !array_key_exists( 'limit', $this->m_params ) ) { |
156 | 156 | $this->m_params['limit'] = $wgRequest->getVal( 'limit' ); |
157 | 157 | |
158 | | - if ( $this->m_params['limit'] == '' ) { |
| 158 | + if ( $this->m_params['limit'] === '' ) { |
159 | 159 | $this->m_params['limit'] = ( $this->m_params['format'] == 'rss' ) ? 10 : 20; // Standard limit for RSS. |
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | 163 | $this->m_params['limit'] = min( $this->m_params['limit'], $smwgQMaxInlineLimit ); |
164 | 164 | |
165 | | - $this->m_editquery = ( $wgRequest->getVal( 'eq' ) == 'yes' ) || ( $this->m_querystring == '' ); |
| 165 | + $this->m_editquery = ( $wgRequest->getVal( 'eq' ) == 'yes' ) || ( $this->m_querystring === '' ); |
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
Index: trunk/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php |
— | — | @@ -25,8 +25,8 @@ |
26 | 26 | $wgOut->setPageTitle( wfMsg( 'exportrdf' ) ); |
27 | 27 | |
28 | 28 | // see if we can find something to export: |
29 | | - $page = ( $page == '' ) ? $wgRequest->getVal( 'page' ) : rawurldecode( $page ); |
30 | | - if ( $page == '' ) { // Try to get POST list; some settings are only available via POST. |
| 29 | + $page = ( $page === '' ) ? $wgRequest->getVal( 'page' ) : rawurldecode( $page ); |
| 30 | + if ( $page === '' ) { // Try to get POST list; some settings are only available via POST. |
31 | 31 | $pageblob = $wgRequest->getText( 'pages' ); |
32 | 32 | if ( $pageblob != '' ) { |
33 | 33 | $pages = explode( "\n", $pageblob ); |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | protected function startRDFExport() { |
91 | 91 | global $wgOut, $wgRequest; |
92 | 92 | $syntax = $wgRequest->getText( 'syntax' ); |
93 | | - if ( $syntax == '' ) $syntax = $wgRequest->getVal( 'syntax' ); |
| 93 | + if ( $syntax === '' ) $syntax = $wgRequest->getVal( 'syntax' ); |
94 | 94 | $wgOut->disable(); |
95 | 95 | ob_start(); |
96 | 96 | if ( $syntax == 'turtle' ) { |
— | — | @@ -120,14 +120,14 @@ |
121 | 121 | |
122 | 122 | $recursive = 0; // default, no recursion |
123 | 123 | $rec = $wgRequest->getText( 'recursive' ); |
124 | | - if ( $rec == '' ) $rec = $wgRequest->getVal( 'recursive' ); |
| 124 | + if ( $rec === '' ) $rec = $wgRequest->getVal( 'recursive' ); |
125 | 125 | if ( ( $rec == '1' ) && ( $smwgAllowRecursiveExport || $wgUser->isAllowed( 'delete' ) ) ) { |
126 | 126 | $recursive = 1; // users may be allowed to switch it on |
127 | 127 | } |
128 | 128 | |
129 | 129 | $backlinks = $smwgExportBacklinks; // default |
130 | 130 | $bl = $wgRequest->getText( 'backlinks' ); |
131 | | - if ( $bl == '' ) $bl = $wgRequest->getVal( 'backlinks' ); |
| 131 | + if ( $bl === '' ) $bl = $wgRequest->getVal( 'backlinks' ); |
132 | 132 | if ( ( $bl == '1' ) && ( $wgUser->isAllowed( 'delete' ) ) ) { |
133 | 133 | $backlinks = true; // admins can always switch on backlinks |
134 | 134 | } elseif ( ( $bl == '0' ) || ( '' == $bl && $postform ) ) { |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | } |
137 | 137 | |
138 | 138 | $date = $wgRequest->getText( 'date' ); |
139 | | - if ( $date == '' ) $date = $wgRequest->getVal( 'date' ); |
| 139 | + if ( $date === '' ) $date = $wgRequest->getVal( 'date' ); |
140 | 140 | if ( $date != '' ) { |
141 | 141 | $timeint = strtotime( $date ); |
142 | 142 | $stamp = date( "YmdHis", $timeint ); |
Index: trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | wfProfileIn( 'SpecialURIResolver::execute (SMW)' ); |
32 | 32 | |
33 | | - if ( $query == '' ) { |
| 33 | + if ( $query === '' ) { |
34 | 34 | if ( stristr( $_SERVER['HTTP_ACCEPT'], 'RDF' ) ) { |
35 | 35 | $wgOut->redirect( SpecialPage::getTitleFor( 'ExportRDF' )->getFullURL( 'stats=1' ), '303' ); |
36 | 36 | } else { |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php |
— | — | @@ -83,11 +83,11 @@ |
84 | 84 | $typeDataValue = SMWTypesValue::newFromTypeId( $typeid ); |
85 | 85 | $propertyDataValue = SMWDataValueFactory::newDataItemValue( $result[0], null ); |
86 | 86 | $typestring = $typeDataValue->getLongHTMLText( $linker ); |
87 | | - if ( $typestring == '' ) $typestring = '–'; /// FIXME some types of builtin props have no name, and another message should be used then |
| 87 | + if ( $typestring === '' ) $typestring = '–'; /// FIXME some types of builtin props have no name, and another message should be used then |
88 | 88 | $proplink = $propertyDataValue->getLongHTMLText( $linker ); |
89 | 89 | } |
90 | 90 | |
91 | | - if ( $typestring == '' ) { |
| 91 | + if ( $typestring === '' ) { |
92 | 92 | global $smwgPDefaultType; |
93 | 93 | $typeDataValue = SMWTypesValue::newFromTypeId( $smwgPDefaultType ); |
94 | 94 | $typestring = $typeDataValue->getLongHTMLText( $linker ); |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -65,8 +65,8 @@ |
66 | 66 | reset( $params ); |
67 | 67 | |
68 | 68 | // no GET parameters? Then try the URL |
69 | | - if ( $this->propertystring == '' ) $this->propertystring = current( $params ); |
70 | | - if ( $this->valuestring == '' ) $this->valuestring = next( $params ); |
| 69 | + if ( $this->propertystring === '' ) $this->propertystring = current( $params ); |
| 70 | + if ( $this->valuestring === '' ) $this->valuestring = next( $params ); |
71 | 71 | |
72 | 72 | $this->valuestring = str_replace( ' ', ' ', $this->valuestring ); |
73 | 73 | $this->valuestring = str_replace( ' ', ' ', $this->valuestring ); |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | global $wgOut, $smwgSearchByPropertyFuzzy; |
112 | 112 | $linker = smwfGetLinker(); |
113 | 113 | |
114 | | - if ( $this->propertystring == '' ) { |
| 114 | + if ( $this->propertystring === '' ) { |
115 | 115 | return '<p>' . wfMsg( 'smw_sbv_docu' ) . "</p>\n"; |
116 | 116 | } |
117 | 117 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -54,14 +54,14 @@ |
55 | 55 | // get the GET parameters |
56 | 56 | $this->articletext = $wgRequest->getVal( 'article' ); |
57 | 57 | // no GET parameters? Then try the URL |
58 | | - if ( $this->articletext == '' ) { |
| 58 | + if ( $this->articletext === '' ) { |
59 | 59 | $params = SMWInfolink::decodeParameters( $query, false ); |
60 | 60 | reset( $params ); |
61 | 61 | $this->articletext = current( $params ); |
62 | 62 | } |
63 | 63 | $this->subject = SMWDataValueFactory::newTypeIDValue( '_wpg', $this->articletext ); |
64 | 64 | $offsettext = $wgRequest->getVal( 'offset' ); |
65 | | - $this->offset = ( $offsettext == '' ) ? 0:intval( $offsettext ); |
| 65 | + $this->offset = ( $offsettext === '' ) ? 0:intval( $offsettext ); |
66 | 66 | $dir = $wgRequest->getVal( 'dir' ); |
67 | 67 | if ( $smwgBrowseShowAll ) { |
68 | 68 | $this->showoutgoing = true; |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php |
— | — | @@ -39,10 +39,10 @@ |
40 | 40 | $limit = $wgRequest->getVal( 'limit' ); |
41 | 41 | $offset = $wgRequest->getVal( 'offset' ); |
42 | 42 | |
43 | | - if ( $limit == '' ) $limit = 20; |
44 | | - if ( $offset == '' ) $offset = 0; |
| 43 | + if ( $limit === '' ) $limit = 20; |
| 44 | + if ( $offset === '' ) $offset = 0; |
45 | 45 | |
46 | | - if ( $propname == '' ) { // No GET parameters? Try the URL: |
| 46 | + if ( $propname === '' ) { // No GET parameters? Try the URL: |
47 | 47 | $queryparts = explode( '::', $query ); |
48 | 48 | $propname = $query; |
49 | 49 | if ( count( $queryparts ) > 1 ) { |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | |
60 | 60 | // Produce output |
61 | 61 | $html = ''; |
62 | | - if ( ( $propname == '' ) ) { // no property given, show a message |
| 62 | + if ( ( $propname === '' ) ) { // no property given, show a message |
63 | 63 | $html .= wfMsg( 'smw_pp_docu' ) . "\n"; |
64 | 64 | } else { // property given, find and display results |
65 | 65 | // FIXME: very ugly, needs i18n |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exp_Element.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | * @return boolean |
79 | 79 | */ |
80 | 80 | public function isBlankNode() { |
81 | | - return ( $this->m_uri == '' ) || ( $this->m_uri{0} == '_' ); |
| 81 | + return ( $this->m_uri === '' ) || ( $this->m_uri{0} == '_' ); |
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php |
— | — | @@ -184,7 +184,7 @@ |
185 | 185 | } |
186 | 186 | $ed = self::getDataItemExpElement( $dataItem ); |
187 | 187 | if ( $ed !== null ) { |
188 | | - if ( ( $property->getKey() == '_CONC' ) && ( $ed->getSubject()->getUri() == '' ) ) { |
| 188 | + if ( ( $property->getKey() == '_CONC' ) && ( $ed->getSubject()->getUri() === '' ) ) { |
189 | 189 | // equivalent to anonymous class -> simplify description |
190 | 190 | foreach ( $ed->getProperties() as $subp ) { |
191 | 191 | if ( $subp->getUri() != self::getSpecialNsResource( 'rdf', 'type' )->getUri() ) { |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | $modifier = $diWikiPage->getSubobjectName(); |
258 | 258 | } |
259 | 259 | |
260 | | - if ( $modifier == '' ) { |
| 260 | + if ( $modifier === '' ) { |
261 | 261 | $importProperty = new SMWDIProperty( '_IMPO' ); |
262 | 262 | $importDis = smwfGetStore()->getPropertyValues( $diWikiPage, $importProperty ); |
263 | 263 | $importURI = ( count( $importDis ) > 0 ); |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | $namespaceId = 'property'; |
278 | 278 | $localName = self::encodeURI( rawurlencode( $diWikiPage->getDBkey() ) ); |
279 | 279 | } |
280 | | - if ( ( $localName == '' ) || |
| 280 | + if ( ( $localName === '' ) || |
281 | 281 | ( in_array( $localName{0}, array( '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ) ) ) ) { |
282 | 282 | $namespace = self::getNamespaceUri( 'wiki' ); |
283 | 283 | $namespaceId = 'wiki'; |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer_Turtle.php |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | } |
201 | 201 | } |
202 | 202 | } |
203 | | - $this->post_ns_buffer .= ( $bnode ? " ]" : " ." ) . ( $indent == '' ? "\n\n" : '' ); |
| 203 | + $this->post_ns_buffer .= ( $bnode ? " ]" : " ." ) . ( $indent === '' ? "\n\n" : '' ); |
204 | 204 | } |
205 | 205 | |
206 | 206 | protected function serializeExpLiteral( SMWExpLiteral $element ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Serializer.php |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | * (what is flushed is gone). |
180 | 180 | */ |
181 | 181 | public function flushContent() { |
182 | | - if ( ( $this->pre_ns_buffer == '' ) && ( $this->post_ns_buffer == '' ) ) return ''; |
| 182 | + if ( ( $this->pre_ns_buffer === '' ) && ( $this->post_ns_buffer === '' ) ) return ''; |
183 | 183 | $this->serializeNamespaces(); |
184 | 184 | $result = $this->pre_ns_buffer . $this->post_ns_buffer; |
185 | 185 | $this->pre_ns_buffer = ''; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -239,7 +239,7 @@ |
240 | 240 | $param = $name . '=' . $param; |
241 | 241 | } |
242 | 242 | |
243 | | - if ( $param == '' ) { |
| 243 | + if ( $param === '' ) { |
244 | 244 | } elseif ( $param { 0 } == '?' ) { // print statement |
245 | 245 | $param = substr( $param, 1 ); |
246 | 246 | $parts = explode( '=', $param, 2 ); |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | |
249 | 249 | $data = null; |
250 | 250 | |
251 | | - if ( trim( $propparts[0] ) == '' ) { // print "this" |
| 251 | + if ( trim( $propparts[0] ) === '' ) { // print "this" |
252 | 252 | $printmode = SMWPrintRequest::PRINT_THIS; |
253 | 253 | $label = ''; // default |
254 | 254 | $title = null; |
— | — | @@ -275,7 +275,7 @@ |
276 | 276 | |
277 | 277 | if ( count( $propparts ) == 1 ) { // no outputformat found, leave empty |
278 | 278 | $propparts[] = false; |
279 | | - } elseif ( trim( $propparts[1] ) == '' ) { // "plain printout", avoid empty string to avoid confusions with "false" |
| 279 | + } elseif ( trim( $propparts[1] ) === '' ) { // "plain printout", avoid empty string to avoid confusions with "false" |
280 | 280 | $propparts[1] = '-'; |
281 | 281 | } |
282 | 282 | |
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | if ( ( $query->querymode == SMWQuery::MODE_INSTANCES ) || ( $query->querymode == SMWQuery::MODE_NONE ) ) { |
392 | 392 | wfProfileIn( 'SMWQueryProcessor::getResultFromQuery-printout (SMW)' ); |
393 | 393 | |
394 | | - if ( $format == '' ) { |
| 394 | + if ( $format === '' ) { |
395 | 395 | $format = self::getResultFormat( $params ); |
396 | 396 | } |
397 | 397 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryLanguage.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | */ |
56 | 56 | public static function getComparatorFromString( $string, $defaultComparator = SMW_CMP_EQ ) { |
57 | 57 | self::initializeComparators(); |
58 | | - if ( $string == '' ) return SMW_CMP_EQ; |
| 58 | + if ( $string === '' ) return SMW_CMP_EQ; |
59 | 59 | return array_key_exists( $string, self::$comparators ) ? self::$comparators[$string] : $defaultComparator; |
60 | 60 | } |
61 | 61 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParserExtensions.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | $value = ''; |
135 | 135 | } |
136 | 136 | |
137 | | - if ( $value == '' ) { // silently ignore empty values |
| 137 | + if ( $value === '' ) { // silently ignore empty values |
138 | 138 | wfProfileOut( 'smwfParsePropertiesCallback (SMW)' ); |
139 | 139 | return ''; |
140 | 140 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Record.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | protected function parseUserValueOrQuery( $value, $queryMode ) { |
28 | | - if ( $value == '' ) { |
| 28 | + if ( $value === '' ) { |
29 | 29 | $this->addError( wfMsg( 'smw_novalues' ) ); |
30 | 30 | |
31 | 31 | if ( $queryMode ) { |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | // generating the DVs: |
66 | | - if ( ( $values[$valueIndex] == '' ) || ( $values[$valueIndex] == '?' ) ) { // explicit omission |
| 66 | + if ( ( $values[$valueIndex] === '' ) || ( $values[$valueIndex] == '?' ) ) { // explicit omission |
67 | 67 | $valueIndex++; |
68 | 68 | } else { |
69 | 69 | $dataValue = SMWDataValueFactory::newPropertyObjectValue( $diProperty, $values[$valueIndex] ); |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Number.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | | - if ( ( count( $parts ) == 1 ) || ( $numstring == '' ) ) { // no number found |
| 89 | + if ( ( count( $parts ) == 1 ) || ( $numstring === '' ) ) { // no number found |
90 | 90 | return 1; |
91 | 91 | } elseif ( is_infinite( $number ) ) { // number is too large for this platform |
92 | 92 | return 2; |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | protected function convertToMainUnit( $number, $unit ) { |
278 | 278 | $this->m_dataitem = new SMWDINumber( $number ); |
279 | 279 | $this->m_unitin = ''; |
280 | | - return ( $unit == '' ); |
| 280 | + return ( $unit === '' ); |
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Bool.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | if ( $formatstring == $this->m_outformat ) return; |
67 | 67 | unset( $this->m_truecaption ); |
68 | 68 | unset( $this->m_falsecaption ); |
69 | | - if ( $formatstring == '' ) { // no format |
| 69 | + if ( $formatstring === '' ) { // no format |
70 | 70 | // (unsetting the captions is exactly the right thing here) |
71 | 71 | } elseif ( strtolower( $formatstring ) == '-' ) { // "plain" format |
72 | 72 | $this->m_truecaption = 'true'; |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Time.php |
— | — | @@ -526,7 +526,7 @@ |
527 | 527 | * @return integer that encodes a three-digit bit vector |
528 | 528 | */ |
529 | 529 | protected static function checkDateComponent( $component, &$numvalue ) { |
530 | | - if ( $component == '' ) { // should not happen |
| 530 | + if ( $component === '' ) { // should not happen |
531 | 531 | $numvalue = 0; |
532 | 532 | return 0; |
533 | 533 | } elseif ( is_numeric( $component ) ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_URI.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | $scheme = $hierpart = $query = $fragment = ''; |
62 | | - if ( $value == '' ) { // do not accept empty strings |
| 62 | + if ( $value === '' ) { // do not accept empty strings |
63 | 63 | $this->addError( wfMsgForContent( 'smw_emptystring' ) ); |
64 | 64 | $this->m_dataitem = new SMWDIUri( 'http', '//example.com', '', '', $this->m_typeid ); // define data item to have some value |
65 | 65 | return; |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | |
183 | 183 | public function getShortWikiText( $linked = null ) { |
184 | 184 | $url = $this->getURL(); |
185 | | - if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $url == '' ) || ( $this->m_caption == '' ) ) { |
| 185 | + if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $url === '' ) || ( $this->m_caption === '' ) ) { |
186 | 186 | return $this->m_caption; |
187 | 187 | } else { |
188 | 188 | return '[' . $url . ' ' . $this->m_caption . ']'; |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | |
192 | 192 | public function getShortHTMLText( $linker = null ) { |
193 | 193 | $url = $this->getURL(); |
194 | | - if ( is_null( $linked ) || ( !$this->isValid() ) || ( $this->m_outformat == '-' ) || ( $url == '' ) || ( $this->m_caption == '' ) ) { |
| 194 | + if ( is_null( $linked ) || ( !$this->isValid() ) || ( $this->m_outformat == '-' ) || ( $url === '' ) || ( $this->m_caption === '' ) ) { |
195 | 195 | return $this->m_caption; |
196 | 196 | } else { |
197 | 197 | return $linker->makeExternalLink( $url, $this->m_caption ); |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | return $this->getErrorText(); |
204 | 204 | } |
205 | 205 | $url = $this->getURL(); |
206 | | - if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $url == '' ) ) { |
| 206 | + if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $url === '' ) ) { |
207 | 207 | return $this->m_wikitext; |
208 | 208 | } else { |
209 | 209 | return '[' . $url . ' ' . $this->m_wikitext . ']'; |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | return $this->getErrorText(); |
216 | 216 | } |
217 | 217 | $url = $this->getURL(); |
218 | | - if ( is_null( $linked ) || ( $this->m_outformat == '-' ) || ( $url == '' ) ) { |
| 218 | + if ( is_null( $linked ) || ( $this->m_outformat == '-' ) || ( $url === '' ) ) { |
219 | 219 | return htmlspecialchars( $this->m_wikitext ); |
220 | 220 | } else { |
221 | 221 | return $linker->makeExternalLink( $url, $this->m_wikitext ); |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php |
— | — | @@ -392,7 +392,7 @@ |
393 | 393 | */ |
394 | 394 | public function getPrefixedText() { |
395 | 395 | global $wgContLang; |
396 | | - if ( $this->m_prefixedtext == '' ) { |
| 396 | + if ( $this->m_prefixedtext === '' ) { |
397 | 397 | if ( $this->isValid() ) { |
398 | 398 | $nstext = $wgContLang->getNSText( $this->m_dataitem->getNamespace() ); |
399 | 399 | $this->m_prefixedtext = |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Types.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |
58 | 58 | $this->m_givenLabel = smwfNormalTitleText( $value ); |
59 | 59 | $this->m_typeId = SMWDataValueFactory::findTypeID( $this->m_givenLabel ); |
60 | | - if ( $this->m_typeId == '' ) { |
| 60 | + if ( $this->m_typeId === '' ) { |
61 | 61 | $this->addError( wfMsgForContent( 'smw_unknowntype', $this->m_givenLabel ) ); |
62 | 62 | $this->m_realLabel = $this->m_givenLabel; |
63 | 63 | } else { |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | protected function loadDataItem( SMWDataItem $dataItem ) { |
82 | 82 | if ( ( $dataItem instanceof SMWDIUri ) && ( $dataItem->getScheme() == 'http' ) && |
83 | 83 | ( $dataItem->getHierpart() == 'semantic-mediawiki.org/swivt/1.0' ) && |
84 | | - ( $dataItem->getQuery() == '' ) ) { |
| 84 | + ( $dataItem->getQuery() === '' ) ) { |
85 | 85 | $this->m_isAlias = false; |
86 | 86 | $this->m_typeId = $dataItem->getFragment(); |
87 | 87 | $this->m_realLabel = SMWDataValueFactory::findTypeLabel( $this->m_typeId ); |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | |
96 | 96 | public function getShortWikiText( $linked = null ) { |
97 | 97 | global $wgContLang; |
98 | | - if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption == '' ) ) { |
| 98 | + if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption === '' ) ) { |
99 | 99 | return $this->m_caption; |
100 | 100 | } else { |
101 | 101 | $titleText = $this->getSpecialPageTitleText(); |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | public function getShortHTMLText( $linked = null ) { |
108 | | - if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption == '' ) ) { |
| 108 | + if ( is_null( $linked ) || ( $linked === false ) || ( $this->m_outformat == '-' ) || ( $this->m_caption === '' ) ) { |
109 | 109 | return htmlspecialchars( $this->m_caption ); |
110 | 110 | } else { |
111 | 111 | $title = Title::makeTitle( NS_SPECIAL, $this->getSpecialPageTitleText() ); |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_String.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | if ( $this->m_caption === false ) { |
20 | 20 | $this->m_caption = ( $this->m_typeid == '_cod' ) ? $this->getCodeDisplay( $value ) : $value; |
21 | 21 | } |
22 | | - if ( $value == '' ) { |
| 22 | + if ( $value === '' ) { |
23 | 23 | $this->addError( wfMsgForContent( 'smw_emptystring' ) ); |
24 | 24 | } |
25 | 25 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php |
— | — | @@ -51,10 +51,10 @@ |
52 | 52 | $result = ''; |
53 | 53 | if ( $outputmode == SMW_OUTPUT_FILE ) { // make RSS feed |
54 | 54 | if ( !$smwgRSSEnabled ) return ''; |
55 | | - if ( $this->m_title == '' ) { |
| 55 | + if ( $this->m_title === '' ) { |
56 | 56 | $this->m_title = $wgSitename; |
57 | 57 | } |
58 | | - if ( $this->m_description == '' ) { |
| 58 | + if ( $this->m_description === '' ) { |
59 | 59 | $this->m_description = wfMsg( 'smw_rss_description', $wgSitename ); |
60 | 60 | } |
61 | 61 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Table.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | $headers[] = Html::rawElement( |
54 | 54 | 'th', |
55 | 55 | $attribs, |
56 | | - $text == '' ? ' ' : $text |
| 56 | + $text === '' ? ' ' : $text |
57 | 57 | ); |
58 | 58 | } |
59 | 59 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryParser.php |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | $this->m_errors[] = wfMsgForContent( 'smw_toomanyclosing', $chunk ); |
180 | 180 | return null; |
181 | 181 | } |
182 | | - } elseif ( $chunk == '' ) { |
| 182 | + } elseif ( $chunk === '' ) { |
183 | 183 | $continue = false; |
184 | 184 | } |
185 | 185 | break; |
— | — | @@ -422,7 +422,7 @@ |
423 | 423 | |
424 | 424 | $list = preg_split( '/:/', $chunk, 3 ); // ":Category:Foo" "User:bar" ":baz" ":+" |
425 | 425 | |
426 | | - if ( ( $list[0] == '' ) && ( count( $list ) == 3 ) ) { |
| 426 | + if ( ( $list[0] === '' ) && ( count( $list ) == 3 ) ) { |
427 | 427 | $list = array_slice( $list, 1 ); |
428 | 428 | } |
429 | 429 | if ( ( count( $list ) == 2 ) && ( $list[1] == '+' ) ) { // try namespace restriction |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | $chunk = $this->readChunk( '\]\]' ); |
490 | 490 | } |
491 | 491 | } |
492 | | - if ( $chunk == '' ) { |
| 492 | + if ( $chunk === '' ) { |
493 | 493 | $this->m_errors[] = wfMsgForContent( 'smw_noclosingbrackets' ); |
494 | 494 | } |
495 | 495 | } |
— | — | @@ -514,7 +514,7 @@ |
515 | 515 | * query string. |
516 | 516 | */ |
517 | 517 | protected function readChunk( $stoppattern = '', $consume = true, $trim = true ) { |
518 | | - if ( $stoppattern == '' ) { |
| 518 | + if ( $stoppattern === '' ) { |
519 | 519 | $stoppattern = '\[\[|\]\]|::|:=|<q>|<\/q>' . |
520 | 520 | '|^' . $this->m_categoryprefix . '|^' . $this->m_categoryPrefixCannonical . |
521 | 521 | '|^' . $this->m_conceptprefix . '|^' . $this->m_conceptPrefixCannonical . |
— | — | @@ -528,7 +528,7 @@ |
529 | 529 | |
530 | 530 | return $trim ? trim( $chunks[0] ) : $chunks[0]; |
531 | 531 | } elseif ( count( $chunks ) == 3 ) { // this should generally happen if count is not 1 |
532 | | - if ( $chunks[0] == '' ) { // string started with delimiter |
| 532 | + if ( $chunks[0] === '' ) { // string started with delimiter |
533 | 533 | if ( $consume ) { |
534 | 534 | $this->m_curstring = $chunks[2]; |
535 | 535 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase.php |
— | — | @@ -203,13 +203,13 @@ |
204 | 204 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_queryEndpoint ); |
205 | 205 | curl_setopt( $this->m_curlhandle, CURLOPT_NOBODY, true ); |
206 | 206 | } elseif ( $endpointType == self::EP_TYPE_UPDATE ) { |
207 | | - if ( $this->m_updateEndpoint == '' ) { |
| 207 | + if ( $this->m_updateEndpoint === '' ) { |
208 | 208 | return false; |
209 | 209 | } |
210 | 210 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_updateEndpoint ); |
211 | 211 | curl_setopt( $this->m_curlhandle, CURLOPT_NOBODY, false ); // 4Store gives 404 instead of 500 with CURLOPT_NOBODY |
212 | 212 | } else { // ( $endpointType == self::EP_TYPE_DATA ) |
213 | | - if ( $this->m_dataEndpoint == '' ) { |
| 213 | + if ( $this->m_dataEndpoint === '' ) { |
214 | 214 | return false; |
215 | 215 | } else { // try an empty POST |
216 | 216 | return $this->doHttpPost( '' ); |
— | — | @@ -480,7 +480,7 @@ |
481 | 481 | * @return boolean |
482 | 482 | */ |
483 | 483 | public function doUpdate( $sparql ) { |
484 | | - if ( $this->m_updateEndpoint == '' ) { |
| 484 | + if ( $this->m_updateEndpoint === '' ) { |
485 | 485 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, $sparql, 'not specified' ); |
486 | 486 | } |
487 | 487 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_updateEndpoint ); |
— | — | @@ -518,7 +518,7 @@ |
519 | 519 | * @return SMWSparqlResultWrapper |
520 | 520 | */ |
521 | 521 | public function doHttpPost( $payload ) { |
522 | | - if ( $this->m_dataEndpoint == '' ) { |
| 522 | + if ( $this->m_dataEndpoint === '' ) { |
523 | 523 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified' ); |
524 | 524 | } |
525 | 525 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint . |
Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlDatabase4Store.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | * @return SMWSparqlResultWrapper |
98 | 98 | */ |
99 | 99 | public function doHttpPost( $payload ) { |
100 | | - if ( $this->m_dataEndpoint == '' ) { |
| 100 | + if ( $this->m_dataEndpoint === '' ) { |
101 | 101 | throw new SMWSparqlDatabaseError( SMWSparqlDatabaseError::ERROR_NOSERVICE, "SPARQL POST with data: $payload", 'not specified' ); |
102 | 102 | } |
103 | 103 | curl_setopt( $this->m_curlhandle, CURLOPT_URL, $this->m_dataEndpoint ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php |
— | — | @@ -442,7 +442,7 @@ |
443 | 443 | if ( $asvalue ) { |
444 | 444 | return $comparator . $dataValue->getWikiValue(); |
445 | 445 | } else { // this only is possible for values of Type:Page |
446 | | - if ( $comparator == '' ) { // some extra care for Category: pages |
| 446 | + if ( $comparator === '' ) { // some extra care for Category: pages |
447 | 447 | return '[[:' . $dataValue->getWikiValue() . ']]'; |
448 | 448 | } else { |
449 | 449 | return '[[' . $comparator . $dataValue->getWikiValue() . ']]'; |
— | — | @@ -512,7 +512,7 @@ |
513 | 513 | $result .= ( $result ? ' ' : '' ) . $desc->getQueryString( false ); |
514 | 514 | } |
515 | 515 | |
516 | | - if ( $result == '' ) { |
| 516 | + if ( $result === '' ) { |
517 | 517 | return $asvalue ? '+' : ''; |
518 | 518 | } else { // <q> not needed for stand-alone conjunctions (AND binds stronger than OR) |
519 | 519 | return $asvalue ? " <q>{$result}</q> " : $result; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStoreLight.php |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | $updates = array(); // collect data for bulk updates; format: tableid => updatearray |
274 | 274 | foreach ( $data->getProperties() as $property ) { |
275 | 275 | $tablename = SMWSQLStoreLight::findPropertyTableName( $property ); |
276 | | - if ( $tablename == '' ) continue; |
| 276 | + if ( $tablename === '' ) continue; |
277 | 277 | foreach ( $data->getPropertyValues( $property ) as $dv ) { |
278 | 278 | if ( !$dv->isValid() ) continue; |
279 | 279 | if ( $dv instanceof SMWContainerValue ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | $entries['SQL Query'] = |
297 | 297 | "<tt>SELECT DISTINCT $qobj->alias.smw_title AS t,$qobj->alias.smw_namespace AS ns FROM " . |
298 | 298 | $this->m_dbs->tableName( $qobj->jointable ) . " AS $qobj->alias" . $qobj->from . |
299 | | - ( ( $qobj->where == '' ) ? '':' WHERE ' ) . $qobj->where . "$tailOpts LIMIT " . |
| 299 | + ( ( $qobj->where === '' ) ? '':' WHERE ' ) . $qobj->where . "$tailOpts LIMIT " . |
300 | 300 | $sql_options['LIMIT'] . ' OFFSET ' . $sql_options['OFFSET'] . ';</tt>'; |
301 | 301 | } else { |
302 | 302 | $entries['SQL Query'] = 'Empty result, no SQL query created.'; |
— | — | @@ -395,7 +395,7 @@ |
396 | 396 | |
397 | 397 | while ( ( $count < $query->getLimit() ) && ( $row = $this->m_dbs->fetchObject( $res ) ) ) { |
398 | 398 | $count++; |
399 | | - if ( $row->iw == '' || $row->iw{0} != ':' ) { |
| 399 | + if ( $row->iw === '' || $row->iw{0} != ':' ) { |
400 | 400 | $v = new SMWDIWikiPage( $row->t, $row->ns, $row->iw, $row->so ); |
401 | 401 | $qr[] = $v; |
402 | 402 | $this->m_store->cacheSMWPageID( $row->id, $row->t, $row->ns, $row->iw, $row->so ); |
— | — | @@ -578,7 +578,7 @@ |
579 | 579 | $tableid = SMWSQLStore2::findPropertyTableID( $property ); |
580 | 580 | $typeid = $property->findPropertyTypeID(); |
581 | 581 | |
582 | | - if ( $tableid == '' ) { // Still no table to query? Give up. |
| 582 | + if ( $tableid === '' ) { // Still no table to query? Give up. |
583 | 583 | $query->type = SMW_SQL2_NOQUERY; |
584 | 584 | return; |
585 | 585 | } |
— | — | @@ -772,7 +772,7 @@ |
773 | 773 | } |
774 | 774 | } |
775 | 775 | |
776 | | - if ( $where == '' ) { // comparators did not apply; match all fields |
| 776 | + if ( $where === '' ) { // comparators did not apply; match all fields |
777 | 777 | $i = 0; |
778 | 778 | |
779 | 779 | foreach ( $proptable->objectfields as $fname => $ftype ) { |
— | — | @@ -830,7 +830,7 @@ |
831 | 831 | $condition = "($condition)"; |
832 | 832 | } |
833 | 833 | |
834 | | - $query->where .= ( ( $query->where == '' ) ? '':' AND ' ) . $condition; |
| 834 | + $query->where .= ( ( $query->where === '' ) ? '':' AND ' ) . $condition; |
835 | 835 | } else { // interpret empty joinfields as impossible condition (empty result) |
836 | 836 | $query->joinfield = ''; // make whole query false |
837 | 837 | $query->jointable = ''; |
— | — | @@ -840,7 +840,7 @@ |
841 | 841 | } |
842 | 842 | |
843 | 843 | if ( $subquery->where != '' ) { |
844 | | - $query->where .= ( ( $query->where == '' ) ? '':' AND ' ) . '(' . $subquery->where . ')'; |
| 844 | + $query->where .= ( ( $query->where === '' ) ? '':' AND ' ) . '(' . $subquery->where . ')'; |
845 | 845 | } |
846 | 846 | |
847 | 847 | $query->from .= $subquery->from; |
— | — | @@ -1051,7 +1051,7 @@ |
1052 | 1052 | |
1053 | 1053 | foreach ( $this->m_sortkeys as $propkey => $order ) { |
1054 | 1054 | if ( !array_key_exists( $propkey, $qobj->sortfields ) ) { // Find missing property to sort by. |
1055 | | - if ( $propkey == '' ) { // Sort by first result column (page titles). |
| 1055 | + if ( $propkey === '' ) { // Sort by first result column (page titles). |
1056 | 1056 | $qobj->sortfields[$propkey] = "$qobj->alias.smw_sortkey"; |
1057 | 1057 | } else { // Try to extend query. |
1058 | 1058 | $extrawhere = ''; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | |
281 | 281 | if ( $sparqlCondition instanceof SMWSparqlSingletonCondition ) { |
282 | 282 | $matchElement = $sparqlCondition->matchElement; |
283 | | - if ( $sparqlCondition->condition == '' ) { // all URIs exist, no querying |
| 283 | + if ( $sparqlCondition->condition === '' ) { // all URIs exist, no querying |
284 | 284 | return 1; |
285 | 285 | } else { |
286 | 286 | $condition = $this->getSparqlConditionString( $sparqlCondition ); |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | |
321 | 321 | if ( $sparqlCondition instanceof SMWSparqlSingletonCondition ) { |
322 | 322 | $matchElement = $sparqlCondition->matchElement; |
323 | | - if ( $sparqlCondition->condition == '' ) { // all URIs exist, no querying |
| 323 | + if ( $sparqlCondition->condition === '' ) { // all URIs exist, no querying |
324 | 324 | $results = array( array ( $matchElement ) ); |
325 | 325 | } else { |
326 | 326 | $condition = $this->getSparqlConditionString( $sparqlCondition ); |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | |
360 | 360 | if ( $sparqlCondition instanceof SMWSparqlSingletonCondition ) { |
361 | 361 | $matchElement = $sparqlCondition->matchElement; |
362 | | - if ( $sparqlCondition->condition == '' ) { // all URIs exist, no querying |
| 362 | + if ( $sparqlCondition->condition === '' ) { // all URIs exist, no querying |
363 | 363 | $sparql = 'None (no conditions).'; |
364 | 364 | } else { |
365 | 365 | $condition = $this->getSparqlConditionString( $sparqlCondition ); |
— | — | @@ -392,7 +392,7 @@ |
393 | 393 | */ |
394 | 394 | protected function getSparqlConditionString( SMWSparqlCondition &$sparqlCondition ) { |
395 | 395 | $condition = $sparqlCondition->getWeakConditionString(); |
396 | | - if ( ( $condition == '' ) && !$sparqlCondition->isSafe() ) { |
| 396 | + if ( ( $condition === '' ) && !$sparqlCondition->isSafe() ) { |
397 | 397 | $swivtPageResource = SMWExporter::getSpecialNsResource( 'swivt', 'page' ); |
398 | 398 | $condition = '?' . self::RESULT_VARIABLE . ' ' . $swivtPageResource->getQName() . " ?url .\n"; |
399 | 399 | } |
— | — | @@ -564,7 +564,7 @@ |
565 | 565 | } |
566 | 566 | $result = new SMWSparqlSingletonCondition( $singletonMatchElement, $condition, |
567 | 567 | $hasSafeSubconditions, $namespaces ); |
568 | | - } elseif ( $condition == '' ) { |
| 568 | + } elseif ( $condition === '' ) { |
569 | 569 | $result = new SMWSparqlFilterCondition( $filter, $namespaces ); |
570 | 570 | } else { |
571 | 571 | if ( $filter != '' ) { |
— | — | @@ -620,7 +620,7 @@ |
621 | 621 | if ( $matchElement instanceof SMWExpNsResource ) { |
622 | 622 | $namespaces[$matchElement->getNamespaceId()] = $matchElement->getNamespace(); |
623 | 623 | } |
624 | | - if ( $subCondition->condition == '' ) { |
| 624 | + if ( $subCondition->condition === '' ) { |
625 | 625 | $filter .= ( $filter ? ' || ' : '' ) . "?$joinVariable = $matchElementName"; |
626 | 626 | } else { |
627 | 627 | $unionCondition .= ( $unionCondition ? ' UNION ' : '' ) . |
— | — | @@ -631,11 +631,11 @@ |
632 | 632 | $weakConditions = array_merge( $weakConditions, $subCondition->weakConditions ); |
633 | 633 | } |
634 | 634 | |
635 | | - if ( ( $unionCondition == '' ) && ( $filter == '' ) ) { |
| 635 | + if ( ( $unionCondition === '' ) && ( $filter === '' ) ) { |
636 | 636 | return new SMWSparqlFalseCondition(); |
637 | | - } elseif ( $unionCondition == '' ) { |
| 637 | + } elseif ( $unionCondition === '' ) { |
638 | 638 | $result = new SMWSparqlFilterCondition( $filter, $namespaces ); |
639 | | - } elseif ( $filter == '' ) { |
| 639 | + } elseif ( $filter === '' ) { |
640 | 640 | $result = new SMWSparqlWhereCondition( $unionCondition, $hasSafeSubconditions, $namespaces ); |
641 | 641 | } else { |
642 | 642 | $subJoinVariable = $this->getNextVariable(); |
— | — | @@ -742,14 +742,14 @@ |
743 | 743 | $categoryName = SMWTurtleSerializer::getTurtleNameForExpElement( $categoryExpElement ); |
744 | 744 | $namespaces[$categoryExpElement->getNamespaceId()] = $categoryExpElement->getNamespace(); |
745 | 745 | $newcondition = "{ ?$joinVariable " . $instExpElement->getQName() . " $categoryName . }\n"; |
746 | | - if ( $condition == '' ) { |
| 746 | + if ( $condition === '' ) { |
747 | 747 | $condition = $newcondition; |
748 | 748 | } else { |
749 | 749 | $condition .= "UNION\n$newcondition"; |
750 | 750 | } |
751 | 751 | } |
752 | 752 | |
753 | | - if ( $condition == '' ) { // empty disjunction: always false, no results to order |
| 753 | + if ( $condition === '' ) { // empty disjunction: always false, no results to order |
754 | 754 | return new SMWSparqlFalseCondition(); |
755 | 755 | } |
756 | 756 | |
— | — | @@ -804,7 +804,7 @@ |
805 | 805 | default: $comparator = ''; // unkown, unsupported |
806 | 806 | } |
807 | 807 | |
808 | | - if ( $comparator == '' ) { |
| 808 | + if ( $comparator === '' ) { |
809 | 809 | $result = $this->buildTrueCondition( $joinVariable, $orderByProperty ); |
810 | 810 | } elseif ( $comparator == '=' ) { |
811 | 811 | $expElement = SMWExporter::getDataItemHelperExpElement( $dataItem ); |
— | — | @@ -922,7 +922,7 @@ |
923 | 923 | protected function addMissingOrderByConditions( SMWSparqlCondition &$sparqlCondition ) { |
924 | 924 | foreach ( $this->m_sortkeys as $propkey => $order ) { |
925 | 925 | if ( !array_key_exists( $propkey, $sparqlCondition->orderVariables ) ) { // Find missing property to sort by. |
926 | | - if ( $propkey == '' ) { // order by result page sortkey |
| 926 | + if ( $propkey === '' ) { // order by result page sortkey |
927 | 927 | $this->addOrderByData( $sparqlCondition, self::RESULT_VARIABLE, SMWDataItem::TYPE_WIKIPAGE ); |
928 | 928 | $sparqlCondition->orderVariables[$propkey] = $sparqlCondition->orderByVariable; |
929 | 929 | } else { // extend query to order by other property values |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php |
— | — | @@ -472,7 +472,7 @@ |
473 | 473 | foreach ( $query->getErrors() as $error ) { |
474 | 474 | $errors .= $error . '<br />'; |
475 | 475 | } |
476 | | - if ( $errors == '' ) { |
| 476 | + if ( $errors === '' ) { |
477 | 477 | $errors = 'None'; |
478 | 478 | } |
479 | 479 | $entries['Errors and Warnings'] = $errors; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | // *** Prepare the cache ***// |
138 | 138 | if ( !array_key_exists( $sid, $this->m_semdata ) ) { // new cache entry |
139 | 139 | $this->m_semdata[$sid] = new SMWSqlStubSemanticData( $subject, false ); |
140 | | - if ( $subject->getSubobjectName() == '' ) { // no sortkey for subobjects |
| 140 | + if ( $subject->getSubobjectName() === '' ) { // no sortkey for subobjects |
141 | 141 | $this->m_semdata[$sid]->addPropertyStubValue( '_SKEY', array( $sortkey ) ); |
142 | 142 | } |
143 | 143 | $this->m_sdstate[$sid] = array(); |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | $pid = $this->getSMWPropertyID( $property ); |
204 | 204 | $tableid = self::findPropertyTableID( $property ); |
205 | 205 | |
206 | | - if ( ( $pid == 0 ) || ( $tableid == '' ) ) { |
| 206 | + if ( ( $pid == 0 ) || ( $tableid === '' ) ) { |
207 | 207 | wfProfileOut( "SMWSQLStore2::getPropertyValues (SMW)" ); |
208 | 208 | return array(); |
209 | 209 | } |
— | — | @@ -369,7 +369,7 @@ |
370 | 370 | |
371 | 371 | // Filter out any accidentally retrieved internal things (interwiki starts with ":"): |
372 | 372 | if ( $proptable->getFieldSignature() != 'p' || count( $valuekeys ) < 3 || |
373 | | - $valuekeys[2] == '' || $valuekeys[2]{0} != ':' ) { |
| 373 | + $valuekeys[2] === '' || $valuekeys[2]{0} != ':' ) { |
374 | 374 | $result[] = $issubject ? array( $propertyname, $valuekeys ) : $valuekeys; |
375 | 375 | } |
376 | 376 | } |
— | — | @@ -405,7 +405,7 @@ |
406 | 406 | $pid = $this->getSMWPropertyID( $property ); |
407 | 407 | $tableid = self::findPropertyTableID( $property ); |
408 | 408 | |
409 | | - if ( ( $pid == 0 ) || ( $tableid == '' ) ) { |
| 409 | + if ( ( $pid == 0 ) || ( $tableid === '' ) ) { |
410 | 410 | wfProfileOut( "SMWSQLStoreLight::getPropertySubjects (SMW)" ); |
411 | 411 | return array(); |
412 | 412 | } |
— | — | @@ -437,7 +437,7 @@ |
438 | 438 | |
439 | 439 | foreach ( $res as $row ) { |
440 | 440 | try { |
441 | | - if ( $row->smw_iw == '' || $row->smw_iw{0} != ':' ) { // filter special objects |
| 441 | + if ( $row->smw_iw === '' || $row->smw_iw{0} != ':' ) { // filter special objects |
442 | 442 | $result[] = new SMWDIWikiPage( $row->smw_title, $row->smw_namespace, $row->smw_iw, $row->smw_subobject ); |
443 | 443 | } |
444 | 444 | } catch ( SMWDataItemException $e ) { |
— | — | @@ -568,7 +568,7 @@ |
569 | 569 | |
570 | 570 | if ( $proptable->idsubject ) { |
571 | 571 | $where = 's_id=' . $db->addQuotes( $sid ); |
572 | | - } elseif ( $subject->getInterwiki() == '' ) { |
| 572 | + } elseif ( $subject->getInterwiki() === '' ) { |
573 | 573 | $where = 's_title=' . $db->addQuotes( $subject->getDBkey() ) . ' AND s_namespace=' . $db->addQuotes( $subject->getNamespace() ); |
574 | 574 | } else { // subjects with non-emtpy interwiki cannot have properties |
575 | 575 | continue; |
— | — | @@ -1492,7 +1492,7 @@ |
1493 | 1493 | |
1494 | 1494 | if ( $row->smw_subobject != '' ) { |
1495 | 1495 | // leave subobjects alone; they ought to be changed with their pages |
1496 | | - } elseif ( $row->smw_iw == '' || $row->smw_iw == SMW_SQL2_SMWREDIIW ) { // objects representing pages |
| 1496 | + } elseif ( $row->smw_iw === '' || $row->smw_iw == SMW_SQL2_SMWREDIIW ) { // objects representing pages |
1497 | 1497 | // TODO: special treament of redirects needed, since the store will |
1498 | 1498 | // not act on redirects that did not change according to its records |
1499 | 1499 | $title = Title::makeTitleSafe( $row->smw_namespace, $row->smw_title ); |
— | — | @@ -1924,7 +1924,7 @@ |
1925 | 1925 | |
1926 | 1926 | $id = $this->m_idCache->getId( $title, $namespace, $iw, $subobjectName ); |
1927 | 1927 | if ( $id == 0 && $smwgQEqualitySupport != SMW_EQ_NONE |
1928 | | - && $subobjectName == '' && $iw == '' ) { |
| 1928 | + && $subobjectName === '' && $iw === '' ) { |
1929 | 1929 | $iw = SMW_SQL2_SMWREDIIW; |
1930 | 1930 | $id = $this->m_idCache->getId( $title, $namespace, SMW_SQL2_SMWREDIIW, $subobjectName ); |
1931 | 1931 | } |
— | — | @@ -1966,7 +1966,7 @@ |
1967 | 1967 | $this->m_idCache->setId( $title, $namespace, $row->smw_iw, $subobjectName, $row->smw_id ); |
1968 | 1968 | |
1969 | 1969 | if ( $row->smw_iw == SMW_SQL2_SMWREDIIW && $canonical && |
1970 | | - $subobjectName == '' && $smwgQEqualitySupport != SMW_EQ_NONE ) { |
| 1970 | + $subobjectName === '' && $smwgQEqualitySupport != SMW_EQ_NONE ) { |
1971 | 1971 | $id = $this->getRedirectId( $title, $namespace ); |
1972 | 1972 | $this->m_idCache->setId( $title, $namespace, $iw, $subobjectName, 0 ); |
1973 | 1973 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SqlStore2IdCache.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | if ( $interwiki == SMW_SQL2_SMWREDIIW ) { |
72 | 72 | $hashKey = self::getHashKey( $title, $namespace, '', $subobject ); |
73 | 73 | $this->m_data[$hashKey] = 0; |
74 | | - } // could do this for $interwiki == '' too, but the SMW_SQL2_SMWREDIIW would be useless |
| 74 | + } // could do this for $interwiki === '' too, but the SMW_SQL2_SMWREDIIW would be useless |
75 | 75 | } |
76 | 76 | |
77 | 77 | public function deleteId( $title, $namespace, $interwiki, $subobject ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_CompatibilityHelpers.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | if ( ( count( $dbkeys ) == 2 ) && ( count( $timedate ) == 2 ) ) { |
57 | 57 | $date = reset( $timedate ); |
58 | 58 | $year = $month = $day = $hours = $minutes = $seconds = $timeoffset = false; |
59 | | - if ( ( end( $timedate ) == '' ) || |
| 59 | + if ( ( end( $timedate ) === '' ) || |
60 | 60 | ( SMWTimeValue::parseTimeString( end( $timedate ), $hours, $minutes, $seconds, $timeoffset ) == true ) ) { |
61 | 61 | $d = explode( '/', $date, 3 ); |
62 | 62 | if ( count( $d ) == 3 ) { |
— | — | @@ -65,8 +65,8 @@ |
66 | 66 | } elseif ( count( $d ) == 1 ) { |
67 | 67 | list( $year ) = $d; |
68 | 68 | } |
69 | | - if ( $month == '' ) $month = false; |
70 | | - if ( $day == '' ) $day = false; |
| 69 | + if ( $month === '' ) $month = false; |
| 70 | + if ( $day === '' ) $day = false; |
71 | 71 | $calendarmodel = SMWDITime::CM_GREGORIAN; |
72 | 72 | return new SMWDITime( $calendarmodel, $year, $month, $day, $hours, $minutes, $seconds ); |
73 | 73 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | if ( array_key_exists( $propertyKey, $this->mProperties ) ) { |
264 | 264 | $property = $this->mProperties[$propertyKey]; |
265 | 265 | } else { |
266 | | - if ( self::$mPropertyPrefix == '' ) { |
| 266 | + if ( self::$mPropertyPrefix === '' ) { |
267 | 267 | global $wgContLang; |
268 | 268 | self::$mPropertyPrefix = $wgContLang->getNsText( SMW_NS_PROPERTY ) . ':'; |
269 | 269 | } // explicitly use prefix to cope with things like [[Property:User:Stupid::somevalue]] |
Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_URI.php |
— | — | @@ -49,10 +49,10 @@ |
50 | 50 | * @todo Implement more validation here. |
51 | 51 | */ |
52 | 52 | public function __construct( $scheme, $hierpart, $query, $fragment ) { |
53 | | - if ( ( $scheme == '' ) || ( preg_match( '/[^a-zA-Z]/u', $scheme ) ) ) { |
| 53 | + if ( ( $scheme === '' ) || ( preg_match( '/[^a-zA-Z]/u', $scheme ) ) ) { |
54 | 54 | throw new SMWDataItemException( "Illegal URI scheme \"$scheme\"." ); |
55 | 55 | } |
56 | | - if ( $hierpart == '' ) { |
| 56 | + if ( $hierpart === '' ) { |
57 | 57 | throw new SMWDataItemException( "Illegal URI hierpart \"$hierpart\"." ); |
58 | 58 | } |
59 | 59 | $this->m_scheme = $scheme; |
Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_WikiPage.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | * @return mixed Title or null |
96 | 96 | */ |
97 | 97 | public function getTitle() { |
98 | | - if ( $this->m_interwiki == '' ) { |
| 98 | + if ( $this->m_interwiki === '' ) { |
99 | 99 | return Title::makeTitleSafe( $this->m_namespace, $this->m_dbkey, $this->m_subobjectname ); |
100 | 100 | } else { // TODO inefficient; incomplete for fragments (see above commment) |
101 | 101 | $datavalue = new SMWWikiPageValue( '_wpg' ); |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | public function getSerialization() { |
108 | | - if ( $this->m_subobjectname == '' ) { |
| 108 | + if ( $this->m_subobjectname === '' ) { |
109 | 109 | return strval( $this->m_dbkey . '#' . strval( $this->m_namespace ) . '#' . $this->m_interwiki ); |
110 | 110 | } else { |
111 | 111 | return strval( $this->m_dbkey . '#' . strval( $this->m_namespace ) . '#' . $this->m_interwiki . '#' . $this->m_subobjectname ); |
Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Container.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | public function hasAnonymousSubject() { |
57 | 57 | if ( $this->mSubject->getNamespace() == NS_SPECIAL && |
58 | 58 | $this->mSubject->getDBkey() == 'SMWInternalObject' && |
59 | | - $this->mSubject->getInterwiki() == '' ) { |
| 59 | + $this->mSubject->getInterwiki() === '' ) { |
60 | 60 | return true; |
61 | 61 | } else { |
62 | 62 | return false; |
Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | * @param $inverse boolean states if the inverse of the property is constructed |
74 | 74 | */ |
75 | 75 | public function __construct( $key, $inverse = false ) { |
76 | | - if ( ( $key == '' ) || ( $key{0} == '-' ) ) { |
| 76 | + if ( ( $key === '' ) || ( $key{0} == '-' ) ) { |
77 | 77 | throw new SMWDataItemException( "Illegal property key \"$key\"." ); |
78 | 78 | } |
79 | 79 | if ( $key{0} == '_' ) { |