r49770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49769‎ | r49770 | r49771 >
Date:10:28, 23 April 2009
Author:ialex
Status:ok
Tags:
Comment:
Documentation fixes:
* corrected @param syntax
* removed useless @private/@public/@access
* removed @abstract and replaced by "STUB" as in FileRepo and File classes
Modified paths:
  • /trunk/phase3/includes/SearchEngine.php (modified) (history)
  • /trunk/phase3/includes/SearchIBM_DB2.php (modified) (history)
  • /trunk/phase3/includes/SearchMySQL.php (modified) (history)
  • /trunk/phase3/includes/SearchOracle.php (modified) (history)
  • /trunk/phase3/includes/SearchPostgres.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SearchEngine.php
@@ -21,11 +21,10 @@
2222 /**
2323 * Perform a full text search query and return a result set.
2424 * If title searches are not supported or disabled, return null.
 25+ * STUB
2526 *
26 - * @param string $term - Raw search term
 27+ * @param $term String: raw search term
2728 * @return SearchResultSet
28 - * @access public
29 - * @abstract
3029 */
3130 function searchText( $term ) {
3231 return null;
@@ -34,11 +33,10 @@
3534 /**
3635 * Perform a title-only search query and return a result set.
3736 * If title searches are not supported or disabled, return null.
 37+ * STUB
3838 *
39 - * @param string $term - Raw search term
 39+ * @param $term String: raw search term
4040 * @return SearchResultSet
41 - * @access public
42 - * @abstract
4341 */
4442 function searchTitle( $term ) {
4543 return null;
@@ -61,7 +59,7 @@
6260 * If an exact title match can be find, or a very slightly close match,
6361 * return the title. If no match, returns NULL.
6462 *
65 - * @param string $term
 63+ * @param $searchterm String
6664 * @return Title
6765 */
6866 public static function getNearMatch( $searchterm ) {
@@ -171,9 +169,8 @@
172170 * Set the maximum number of results to return
173171 * and how many to skip before returning the first.
174172 *
175 - * @param int $limit
176 - * @param int $offset
177 - * @access public
 173+ * @param $limit Integer
 174+ * @param $offset Integer
178175 */
179176 function setLimitOffset( $limit, $offset = 0 ) {
180177 $this->limit = intval( $limit );
@@ -184,8 +181,7 @@
185182 * Set which namespaces the search should include.
186183 * Give an array of namespace index numbers.
187184 *
188 - * @param array $namespaces
189 - * @access public
 185+ * @param $namespaces Array
190186 */
191187 function setNamespaces( $namespaces ) {
192188 $this->namespaces = $namespaces;
@@ -195,7 +191,7 @@
196192 * Parse some common prefixes: all (search everything)
197193 * or namespace names
198194 *
199 - * @param string $query
 195+ * @param $query String
200196 */
201197 function replacePrefixes( $query ){
202198 global $wgContLang;
@@ -224,7 +220,7 @@
225221
226222 /**
227223 * Make a list of searchable namespaces and their canonical names.
228 - * @return array
 224+ * @return Array
229225 */
230226 public static function searchableNamespaces() {
231227 global $wgContLang;
@@ -241,9 +237,8 @@
242238 * Extract default namespaces to search from the given user's
243239 * settings, returning a list of index numbers.
244240 *
245 - * @param User $user
246 - * @return array
247 - * @static
 241+ * @param $user User
 242+ * @return Array
248243 */
249244 public static function userNamespaces( &$user ) {
250245 $arr = array();
@@ -258,9 +253,8 @@
259254 /**
260255 * Find snippet highlight settings for a given user
261256 *
262 - * @param User $user
263 - * @return array contextlines, contextchars
264 - * @static
 257+ * @param $user User
 258+ * @return Array contextlines, contextchars
265259 */
266260 public static function userHighlightPrefs( &$user ){
267261 //$contextlines = $user->getOption( 'contextlines', 5 );
@@ -273,8 +267,7 @@
274268 /**
275269 * An array of namespaces indexes to be searched by default
276270 *
277 - * @return array
278 - * @static
 271+ * @return Array
279272 */
280273 public static function defaultNamespaces(){
281274 global $wgNamespacesToBeSearchedDefault;
@@ -286,7 +279,7 @@
287280 * Get a list of namespace names useful for showing in tooltips
288281 * and preferences
289282 *
290 - * @param unknown_type $namespaces
 283+ * @param $namespaces Array
291284 */
292285 public static function namespacesAsText( $namespaces ){
293286 global $wgContLang;
@@ -303,8 +296,7 @@
304297 * An array of "project" namespaces indexes typically searched
305298 * by logged-in users
306299 *
307 - * @return array
308 - * @static
 300+ * @return Array
309301 */
310302 public static function projectNamespaces() {
311303 global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject;
@@ -316,8 +308,7 @@
317309 * An array of "project" namespaces indexes typically searched
318310 * by logged-in users in addition to the default namespaces
319311 *
320 - * @return array
321 - * @static
 312+ * @return Array
322313 */
323314 public static function defaultAndProjectNamespaces() {
324315 global $wgNamespacesToBeSearchedDefault, $wgNamespacesToBeSearchedProject;
@@ -329,8 +320,8 @@
330321 /**
331322 * Return a 'cleaned up' search string
332323 *
333 - * @return string
334 - * @access public
 324+ * @param $text String
 325+ * @return String
335326 */
336327 function filter( $text ) {
337328 $lc = $this->legalSearchChars();
@@ -358,11 +349,11 @@
359350 /**
360351 * Create or update the search index record for the given page.
361352 * Title and text should be pre-processed.
 353+ * STUB
362354 *
363 - * @param int $id
364 - * @param string $title
365 - * @param string $text
366 - * @abstract
 355+ * @param $id Integer
 356+ * @param $title String
 357+ * @param $text String
367358 */
368359 function update( $id, $title, $text ) {
369360 // no-op
@@ -371,10 +362,10 @@
372363 /**
373364 * Update a search index record's title only.
374365 * Title should be pre-processed.
 366+ * STUB
375367 *
376 - * @param int $id
377 - * @param string $title
378 - * @abstract
 368+ * @param $id Integer
 369+ * @param $title String
379370 */
380371 function updateTitle( $id, $title ) {
381372 // no-op
@@ -383,8 +374,7 @@
384375 /**
385376 * Get OpenSearch suggestion template
386377 *
387 - * @return string
388 - * @static
 378+ * @return String
389379 */
390380 public static function getOpenSearchTemplate() {
391381 global $wgOpenSearchTemplate, $wgServer, $wgScriptPath;
@@ -400,8 +390,7 @@
401391 /**
402392 * Get internal MediaWiki Suggest template
403393 *
404 - * @return string
405 - * @static
 394+ * @return String
406395 */
407396 public static function getMWSuggestTemplate() {
408397 global $wgMWSuggestTemplate, $wgServer, $wgScriptPath;
@@ -419,10 +408,9 @@
420409 /**
421410 * Fetch an array of regular expression fragments for matching
422411 * the search terms as parsed by this engine in a text extract.
 412+ * STUB
423413 *
424 - * @return array
425 - * @access public
426 - * @abstract
 414+ * @return Array
427415 */
428416 function termMatches() {
429417 return array();
@@ -434,8 +422,9 @@
435423
436424 /**
437425 * Return true if results are included in this result set.
438 - * @return bool
439 - * @abstract
 426+ * STUB
 427+ *
 428+ * @return Boolean
440429 */
441430 function hasResults() {
442431 return false;
@@ -449,8 +438,7 @@
450439 *
451440 * Return null if no total hits number is supported.
452441 *
453 - * @return int
454 - * @access public
 442+ * @return Integer
455443 */
456444 function getTotalHits() {
457445 return null;
@@ -460,22 +448,21 @@
461449 * Some search modes return a suggested alternate term if there are
462450 * no exact hits. Returns true if there is one on this set.
463451 *
464 - * @return bool
465 - * @access public
 452+ * @return Boolean
466453 */
467454 function hasSuggestion() {
468455 return false;
469456 }
470457
471458 /**
472 - * @return string suggested query, null if none
 459+ * @return String: suggested query, null if none
473460 */
474461 function getSuggestionQuery(){
475462 return null;
476463 }
477464
478465 /**
479 - * @return string HTML highlighted suggested query, '' if none
 466+ * @return String: HTML highlighted suggested query, '' if none
480467 */
481468 function getSuggestionSnippet(){
482469 return '';
@@ -485,7 +472,7 @@
486473 * Return information about how and from where the results were fetched,
487474 * should be useful for diagnostics and debugging
488475 *
489 - * @return string
 476+ * @return String
490477 */
491478 function getInfo() {
492479 return null;
@@ -503,7 +490,7 @@
504491 /**
505492 * Check if there are results on other wikis
506493 *
507 - * @return boolean
 494+ * @return Boolean
508495 */
509496 function hasInterwikiResults() {
510497 return $this->getInterwikiResults() != null;
@@ -512,9 +499,9 @@
513500
514501 /**
515502 * Fetches next search result, or false.
 503+ * STUB
 504+ *
516505 * @return SearchResult
517 - * @access public
518 - * @abstract
519506 */
520507 function next() {
521508 return false;
@@ -522,7 +509,6 @@
523510
524511 /**
525512 * Frees the result set, if applicable.
526 - * @ access public
527513 */
528514 function free() {
529515 // ...
@@ -539,9 +525,9 @@
540526
541527
542528 /**
543 - * @fixme This class is horribly factored. It would probably be better to have
544 - * a useful base class to which you pass some standard information, then let
545 - * the fancy self-highlighters extend that.
 529+ * @todo Fixme: This class is horribly factored. It would probably be better to
 530+ * have a useful base class to which you pass some standard information, then
 531+ * let the fancy self-highlighters extend that.
546532 * @ingroup Search
547533 */
548534 class SearchResult {
@@ -560,8 +546,7 @@
561547 /**
562548 * Check if this is result points to an invalid title
563549 *
564 - * @return boolean
565 - * @access public
 550+ * @return Boolean
566551 */
567552 function isBrokenTitle(){
568553 if( is_null($this->mTitle) )
@@ -572,8 +557,7 @@
573558 /**
574559 * Check if target page is missing, happens when index is out of date
575560 *
576 - * @return boolean
577 - * @access public
 561+ * @return Boolean
578562 */
579563 function isMissingRevision(){
580564 return !$this->mRevision && !$this->mImage;
@@ -581,14 +565,13 @@
582566
583567 /**
584568 * @return Title
585 - * @access public
586569 */
587570 function getTitle() {
588571 return $this->mTitle;
589572 }
590573
591574 /**
592 - * @return double or null if not supported
 575+ * @return Double or null if not supported
593576 */
594577 function getScore() {
595578 return null;
@@ -608,8 +591,8 @@
609592 }
610593
611594 /**
612 - * @param array $terms terms to highlight
613 - * @return string highlighted text snippet, null (and not '') if not supported
 595+ * @param $terms Array: terms to highlight
 596+ * @return String: highlighted text snippet, null (and not '') if not supported
614597 */
615598 function getTextSnippet($terms){
616599 global $wgUser, $wgAdvancedSearchHighlighting;
@@ -623,16 +606,16 @@
624607 }
625608
626609 /**
627 - * @param array $terms terms to highlight
628 - * @return string highlighted title, '' if not supported
 610+ * @param $terms Array: terms to highlight
 611+ * @return String: highlighted title, '' if not supported
629612 */
630613 function getTitleSnippet($terms){
631614 return '';
632615 }
633616
634617 /**
635 - * @param array $terms terms to highlight
636 - * @return string highlighted redirect name (redirect to this page), '' if none or not supported
 618+ * @param $terms Array: terms to highlight
 619+ * @return String: highlighted redirect name (redirect to this page), '' if none or not supported
637620 */
638621 function getRedirectSnippet($terms){
639622 return '';
@@ -660,7 +643,7 @@
661644 }
662645
663646 /**
664 - * @return string timestamp
 647+ * @return String: timestamp
665648 */
666649 function getTimestamp(){
667650 if( $this->mRevision )
@@ -671,7 +654,7 @@
672655 }
673656
674657 /**
675 - * @return int number of words
 658+ * @return Integer: number of words
676659 */
677660 function getWordCount(){
678661 $this->initText();
@@ -679,7 +662,7 @@
680663 }
681664
682665 /**
683 - * @return int size in bytes
 666+ * @return Integer: size in bytes
684667 */
685668 function getByteSize(){
686669 $this->initText();
@@ -687,14 +670,14 @@
688671 }
689672
690673 /**
691 - * @return boolean if hit has related articles
 674+ * @return Boolean if hit has related articles
692675 */
693676 function hasRelated(){
694677 return false;
695678 }
696679
697680 /**
698 - * @return interwiki prefix of the title (return iw even if title is broken)
 681+ * @return String: interwiki prefix of the title (return iw even if title is broken)
699682 */
700683 function getInterwikiPrefix(){
701684 return '';
@@ -716,11 +699,11 @@
717700 /**
718701 * Default implementation of wikitext highlighting
719702 *
720 - * @param string $text
721 - * @param array $terms Terms to highlight (unescaped)
722 - * @param int $contextlines
723 - * @param int $contextchars
724 - * @return string
 703+ * @param $text String
 704+ * @param $terms Array: terms to highlight (unescaped)
 705+ * @param $contextlines Integer
 706+ * @param $contextchars Integer
 707+ * @return String
725708 */
726709 public function highlightText( $text, $terms, $contextlines, $contextchars ) {
727710 global $wgLang, $wgContLang;
@@ -958,9 +941,9 @@
959942 /**
960943 * Split text into lines and add it to extracts array
961944 *
962 - * @param array $extracts index -> $line
963 - * @param int $count
964 - * @param string $text
 945+ * @param $extracts Array: index -> $line
 946+ * @param $count Integer
 947+ * @param $text String
965948 */
966949 function splitAndAdd(&$extracts, &$count, $text){
967950 $split = explode( "\n", $this->mCleanWikitext? $this->removeWiki($text) : $text );
@@ -974,7 +957,7 @@
975958 /**
976959 * Do manual case conversion for non-ascii chars
977960 *
978 - * @param unknown_type $matches
 961+ * @param $matches Array
979962 */
980963 function caseCallback($matches){
981964 global $wgContLang;
@@ -987,12 +970,12 @@
988971 /**
989972 * Extract part of the text from start to end, but by
990973 * not chopping up words
991 - * @param string $text
992 - * @param int $start
993 - * @param int $end
994 - * @param int $posStart (out) actual start position
995 - * @param int $posEnd (out) actual end position
996 - * @return string
 974+ * @param $text String
 975+ * @param $start Integer
 976+ * @param $end Integer
 977+ * @param $posStart Integer: (out) actual start position
 978+ * @param $posEnd Integer: (out) actual end position
 979+ * @return String
997980 */
998981 function extract($text, $start, $end, &$posStart = null, &$posEnd = null ){
999982 global $wgContLang;
@@ -1018,10 +1001,10 @@
10191002 /**
10201003 * Find a nonletter near a point (index) in the text
10211004 *
1022 - * @param string $text
1023 - * @param int $point
1024 - * @param int $offset to found index
1025 - * @return int nearest nonletter index, or beginning of utf8 char if none
 1005+ * @param $text String
 1006+ * @param $point Integer
 1007+ * @param $offset Integer: offset to found index
 1008+ * @return Integer: nearest nonletter index, or beginning of utf8 char if none
10261009 */
10271010 function position($text, $point, $offset=0 ){
10281011 $tolerance = 10;
@@ -1048,12 +1031,12 @@
10491032 /**
10501033 * Search extracts for a pattern, and return snippets
10511034 *
1052 - * @param string $pattern regexp for matching lines
1053 - * @param array $extracts extracts to search
1054 - * @param int $linesleft number of extracts to make
1055 - * @param int $contextchars length of snippet
1056 - * @param array $out map for highlighted snippets
1057 - * @param array $offsets map of starting points of snippets
 1035+ * @param $pattern String: regexp for matching lines
 1036+ * @param $extracts Array: extracts to search
 1037+ * @param $linesleft Integer: number of extracts to make
 1038+ * @param $contextchars Integer: length of snippet
 1039+ * @param $out Array: map for highlighted snippets
 1040+ * @param $offsets Array: map of starting points of snippets
10581041 * @protected
10591042 */
10601043 function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ){
@@ -1120,7 +1103,7 @@
11211104 * callback to replace [[target|caption]] kind of links, if
11221105 * the target is category or image, leave it
11231106 *
1124 - * @param array $matches
 1107+ * @param $matches Array
11251108 */
11261109 function linkReplace($matches){
11271110 $colon = strpos( $matches[1], ':' );
@@ -1140,11 +1123,11 @@
11411124 * Simple & fast snippet extraction, but gives completely unrelevant
11421125 * snippets
11431126 *
1144 - * @param string $text
1145 - * @param array $terms
1146 - * @param int $contextlines
1147 - * @param int $contextchars
1148 - * @return string
 1127+ * @param $text String
 1128+ * @param $terms Array
 1129+ * @param $contextlines Integer
 1130+ * @param $contextchars Integer
 1131+ * @return String
11491132 */
11501133 public function highlightSimple( $text, $terms, $contextlines, $contextchars ) {
11511134 global $wgLang, $wgContLang;
@@ -1196,7 +1179,7 @@
11971180
11981181 /**
11991182 * Dummy class to be used when non-supported Database engine is present.
1200 - * @fixme Dummy class should probably try something at least mildly useful,
 1183+ * @todo Fixme: dummy class should probably try something at least mildly useful,
12011184 * such as a LIKE search through titles.
12021185 * @ingroup Search
12031186 */
Index: trunk/phase3/includes/SearchPostgres.php
@@ -37,9 +37,8 @@
3838 * Currently searches a page's current title (page.page_title) and
3939 * latest revision article text (pagecontent.old_text)
4040 *
41 - * @param string $term - Raw search term
 41+ * @param $term String: raw search term
4242 * @return PostgresSearchResultSet
43 - * @access public
4443 */
4544 function searchTitle( $term ) {
4645 $q = $this->searchQuery( $term , 'titlevector', 'page_title' );
@@ -130,9 +129,8 @@
131130
132131 /**
133132 * Construct the full SQL query to do the search.
134 - * @param string $filteredTerm
135 - * @param string $fulltext
136 - * @private
 133+ * @param $filteredTerm String
 134+ * @param $fulltext String
137135 */
138136 function searchQuery( $term, $fulltext, $colname ) {
139137 global $wgDBversion;
Index: trunk/phase3/includes/SearchOracle.php
@@ -34,9 +34,8 @@
3535 /**
3636 * Perform a full text search query and return a result set.
3737 *
38 - * @param string $term - Raw search term
 38+ * @param $term String: raw search term
3939 * @return OracleSearchResultSet
40 - * @access public
4140 */
4241 function searchText( $term ) {
4342 $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), true)));
@@ -46,9 +45,8 @@
4746 /**
4847 * Perform a title-only search query and return a result set.
4948 *
50 - * @param string $term - Raw search term
 49+ * @param $term String: raw search term
5150 * @return ORacleSearchResultSet
52 - * @access public
5351 */
5452 function searchTitle($term) {
5553 $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), false)));
@@ -58,8 +56,7 @@
5957
6058 /**
6159 * Return a partial WHERE clause to exclude redirects, if so set
62 - * @return string
63 - * @private
 60+ * @return String
6461 */
6562 function queryRedirect() {
6663 if ($this->showRedirects) {
@@ -71,8 +68,7 @@
7269
7370 /**
7471 * Return a partial WHERE clause to limit the search to the given namespaces
75 - * @return string
76 - * @private
 72+ * @return String
7773 */
7874 function queryNamespaces() {
7975 if( is_null($this->namespaces) )
@@ -87,8 +83,7 @@
8884
8985 /**
9086 * Return a LIMIT clause to limit results on the query.
91 - * @return string
92 - * @private
 87+ * @return String
9388 */
9489 function queryLimit($sql) {
9590 return $this->db->limitResult($sql, $this->limit, $this->offset);
@@ -97,8 +92,7 @@
9893 /**
9994 * Does not do anything for generic search engine
10095 * subclasses may define this though
101 - * @return string
102 - * @private
 96+ * @return String
10397 */
10498 function queryRanking($filteredTerm, $fulltext) {
10599 return ' ORDER BY score(1)';
@@ -107,9 +101,8 @@
108102 /**
109103 * Construct the full SQL query to do the search.
110104 * The guts shoulds be constructed in queryMain()
111 - * @param string $filteredTerm
112 - * @param bool $fulltext
113 - * @private
 105+ * @param $filteredTerm String
 106+ * @param $fulltext Boolean
114107 */
115108 function getQuery( $filteredTerm, $fulltext ) {
116109 return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
@@ -121,8 +114,8 @@
122115
123116 /**
124117 * Picks which field to index on, depending on what type of query.
125 - * @param bool $fulltext
126 - * @return string
 118+ * @param $fulltext Boolean
 119+ * @return String
127120 */
128121 function getIndexField($fulltext) {
129122 return $fulltext ? 'si_text' : 'si_title';
@@ -131,10 +124,9 @@
132125 /**
133126 * Get the base part of the search query.
134127 *
135 - * @param string $filteredTerm
136 - * @param bool $fulltext
137 - * @return string
138 - * @private
 128+ * @param $filteredTerm String
 129+ * @param $fulltext Boolean
 130+ * @return String
139131 */
140132 function queryMain( $filteredTerm, $fulltext ) {
141133 $match = $this->parseQuery($filteredTerm, $fulltext);
@@ -183,9 +175,9 @@
184176 * Create or update the search index record for the given page.
185177 * Title and text should be pre-processed.
186178 *
187 - * @param int $id
188 - * @param string $title
189 - * @param string $text
 179+ * @param $id Integer
 180+ * @param $title String
 181+ * @param $text String
190182 */
191183 function update($id, $title, $text) {
192184 $dbw = wfGetDB(DB_MASTER);
Index: trunk/phase3/includes/SearchIBM_DB2.php
@@ -34,9 +34,8 @@
3535 /**
3636 * Perform a full text search query and return a result set.
3737 *
38 - * @param string $term - Raw search term
 38+ * @param $term String: raw search term
3939 * @return IBM_DB2SearchResultSet
40 - * @access public
4140 */
4241 function searchText( $term ) {
4342 $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), true)));
@@ -46,9 +45,8 @@
4746 /**
4847 * Perform a title-only search query and return a result set.
4948 *
50 - * @param string $term - Raw search term
 49+ * @param $term String: taw search term
5150 * @return IBM_DB2SearchResultSet
52 - * @access public
5351 */
5452 function searchTitle($term) {
5553 $resultSet = $this->db->resultObject($this->db->query($this->getQuery($this->filter($term), false)));
@@ -58,8 +56,7 @@
5957
6058 /**
6159 * Return a partial WHERE clause to exclude redirects, if so set
62 - * @return string
63 - * @private
 60+ * @return String
6461 */
6562 function queryRedirect() {
6663 if ($this->showRedirects) {
@@ -71,8 +68,7 @@
7269
7370 /**
7471 * Return a partial WHERE clause to limit the search to the given namespaces
75 - * @return string
76 - * @private
 72+ * @return String
7773 */
7874 function queryNamespaces() {
7975 if( is_null($this->namespaces) )
@@ -86,8 +82,7 @@
8783
8884 /**
8985 * Return a LIMIT clause to limit results on the query.
90 - * @return string
91 - * @private
 86+ * @return String
9287 */
9388 function queryLimit($sql) {
9489 return $this->db->limitResult($sql, $this->limit, $this->offset);
@@ -96,8 +91,7 @@
9792 /**
9893 * Does not do anything for generic search engine
9994 * subclasses may define this though
100 - * @return string
101 - * @private
 95+ * @return String
10296 */
10397 function queryRanking($filteredTerm, $fulltext) {
10498 // requires Net Search Extender or equivalent
@@ -108,9 +102,8 @@
109103 /**
110104 * Construct the full SQL query to do the search.
111105 * The guts shoulds be constructed in queryMain()
112 - * @param string $filteredTerm
113 - * @param bool $fulltext
114 - * @private
 106+ * @param string $filteredTerm String
 107+ * @param bool $fulltext Boolean
115108 */
116109 function getQuery( $filteredTerm, $fulltext ) {
117110 return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
@@ -122,8 +115,8 @@
123116
124117 /**
125118 * Picks which field to index on, depending on what type of query.
126 - * @param bool $fulltext
127 - * @return string
 119+ * @param $fulltext Boolean
 120+ * @return String
128121 */
129122 function getIndexField($fulltext) {
130123 return $fulltext ? 'si_text' : 'si_title';
@@ -132,10 +125,9 @@
133126 /**
134127 * Get the base part of the search query.
135128 *
136 - * @param string $filteredTerm
137 - * @param bool $fulltext
138 - * @return string
139 - * @private
 129+ * @param string $filteredTerm String
 130+ * @param bool $fulltext Boolean
 131+ * @return String
140132 */
141133 function queryMain( $filteredTerm, $fulltext ) {
142134 $match = $this->parseQuery($filteredTerm, $fulltext);
@@ -185,9 +177,9 @@
186178 * Create or update the search index record for the given page.
187179 * Title and text should be pre-processed.
188180 *
189 - * @param int $id
190 - * @param string $title
191 - * @param string $text
 181+ * @param $id Integer
 182+ * @param $title String
 183+ * @param $text String
192184 */
193185 function update($id, $title, $text) {
194186 $dbw = wfGetDB(DB_MASTER);
@@ -207,8 +199,8 @@
208200 * Update a search index record's title only.
209201 * Title should be pre-processed.
210202 *
211 - * @param int $id
212 - * @param string $title
 203+ * @param $id Integer
 204+ * @param $title String
213205 */
214206 function updateTitle($id, $title) {
215207 $dbw = wfGetDB(DB_MASTER);
Index: trunk/phase3/includes/SearchMySQL.php
@@ -86,9 +86,8 @@
8787 /**
8888 * Perform a full text search query and return a result set.
8989 *
90 - * @param string $term - Raw search term
 90+ * @param $term String: raw search term
9191 * @return MySQLSearchResultSet
92 - * @access public
9392 */
9493 function searchText( $term ) {
9594 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), true ) ) );
@@ -98,9 +97,8 @@
9998 /**
10099 * Perform a title-only search query and return a result set.
101100 *
102 - * @param string $term - Raw search term
 101+ * @param $term String: raw search term
103102 * @return MySQLSearchResultSet
104 - * @access public
105103 */
106104 function searchTitle( $term ) {
107105 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) );
@@ -110,8 +108,7 @@
111109
112110 /**
113111 * Return a partial WHERE clause to exclude redirects, if so set
114 - * @return string
115 - * @private
 112+ * @return String
116113 */
117114 function queryRedirect() {
118115 if( $this->showRedirects ) {
@@ -123,8 +120,7 @@
124121
125122 /**
126123 * Return a partial WHERE clause to limit the search to the given namespaces
127 - * @return string
128 - * @private
 124+ * @return String
129125 */
130126 function queryNamespaces() {
131127 if( is_null($this->namespaces) )
@@ -139,8 +135,7 @@
140136
141137 /**
142138 * Return a LIMIT clause to limit results on the query.
143 - * @return string
144 - * @private
 139+ * @return String
145140 */
146141 function queryLimit() {
147142 return $this->db->limitResult( '', $this->limit, $this->offset );
@@ -149,8 +144,7 @@
150145 /**
151146 * Does not do anything for generic search engine
152147 * subclasses may define this though
153 - * @return string
154 - * @private
 148+ * @return String
155149 */
156150 function queryRanking( $filteredTerm, $fulltext ) {
157151 return '';
@@ -159,9 +153,8 @@
160154 /**
161155 * Construct the full SQL query to do the search.
162156 * The guts shoulds be constructed in queryMain()
163 - * @param string $filteredTerm
164 - * @param bool $fulltext
165 - * @private
 157+ * @param $filteredTerm String
 158+ * @param $fulltext Boolean
166159 */
167160 function getQuery( $filteredTerm, $fulltext ) {
168161 return $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
@@ -174,8 +167,8 @@
175168
176169 /**
177170 * Picks which field to index on, depending on what type of query.
178 - * @param bool $fulltext
179 - * @return string
 171+ * @param $fulltext Boolean
 172+ * @return String
180173 */
181174 function getIndexField( $fulltext ) {
182175 return $fulltext ? 'si_text' : 'si_title';
@@ -187,10 +180,9 @@
188181 * version; MySQL 3 and MySQL 4 have different capabilities
189182 * in their fulltext search indexes.
190183 *
191 - * @param string $filteredTerm
192 - * @param bool $fulltext
193 - * @return string
194 - * @private
 184+ * @param $filteredTerm String
 185+ * @param $fulltext Boolean
 186+ * @return String
195187 */
196188 function queryMain( $filteredTerm, $fulltext ) {
197189 $match = $this->parseQuery( $filteredTerm, $fulltext );
@@ -205,9 +197,9 @@
206198 * Create or update the search index record for the given page.
207199 * Title and text should be pre-processed.
208200 *
209 - * @param int $id
210 - * @param string $title
211 - * @param string $text
 201+ * @param $id Integer
 202+ * @param $title String
 203+ * @param $text String
212204 */
213205 function update( $id, $title, $text ) {
214206 $dbw = wfGetDB( DB_MASTER );
@@ -224,8 +216,8 @@
225217 * Update a search index record's title only.
226218 * Title should be pre-processed.
227219 *
228 - * @param int $id
229 - * @param string $title
 220+ * @param $id Integer
 221+ * @param $title String
230222 */
231223 function updateTitle( $id, $title ) {
232224 $dbw = wfGetDB( DB_MASTER );

Status & tagging log