Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / search / SearchEngine.php
index a96ade0..827d8c3 100644 (file)
@@ -35,10 +35,9 @@ class SearchEngine {
        var $prefix = '';
        var $searchTerms = array();
        var $namespaces = array( NS_MAIN );
-       var $showRedirects = false;
        protected $showSuggestion = true;
 
-       /// Feature values
+       /** @var array Feature values */
        protected $features = array();
 
        /**
@@ -46,7 +45,7 @@ class SearchEngine {
         * If title searches are not supported or disabled, return null.
         * STUB
         *
-        * @param string $term raw search term
+        * @param string $term Raw search term
         * @return SearchResultSet|Status|null
         */
        function searchText( $term ) {
@@ -58,7 +57,7 @@ class SearchEngine {
         * If title searches are not supported or disabled, return null.
         * STUB
         *
-        * @param string $term raw search term
+        * @param string $term Raw search term
         * @return SearchResultSet|null
         */
        function searchTitle( $term ) {
@@ -67,12 +66,11 @@ class SearchEngine {
 
        /**
         * @since 1.18
-        * @param $feature String
-        * @return Boolean
+        * @param string $feature
+        * @return bool
         */
        public function supports( $feature ) {
                switch ( $feature ) {
-               case 'list-redirects':
                case 'search-update':
                        return true;
                case 'title-suffix-filter':
@@ -84,8 +82,8 @@ class SearchEngine {
        /**
         * Way to pass custom data for engines
         * @since 1.18
-        * @param $feature String
-        * @param $data Mixed
+        * @param string $feature
+        * @param mixed $data
         * @return bool
         */
        public function setFeatureData( $feature, $data ) {
@@ -119,7 +117,7 @@ class SearchEngine {
         * If an exact title match can be found, or a very slightly close match,
         * return the title. If no match, returns NULL.
         *
-        * @param $searchterm String
+        * @param string $searchterm
         * @return Title
         */
        public static function getNearMatch( $searchterm ) {
@@ -133,7 +131,7 @@ class SearchEngine {
         * Do a near match (see SearchEngine::getNearMatch) and wrap it into a
         * SearchResultSet.
         *
-        * @param $searchterm string
+        * @param string $searchterm
         * @return SearchResultSet
         */
        public static function getNearMatchResultSet( $searchterm ) {
@@ -264,8 +262,8 @@ class SearchEngine {
         * Set the maximum number of results to return
         * and how many to skip before returning the first.
         *
-        * @param $limit Integer
-        * @param $offset Integer
+        * @param int $limit
+        * @param int $offset
         */
        function setLimitOffset( $limit, $offset = 0 ) {
                $this->limit = intval( $limit );
@@ -276,7 +274,7 @@ class SearchEngine {
         * Set which namespaces the search should include.
         * Give an array of namespace index numbers.
         *
-        * @param $namespaces Array
+        * @param array $namespaces
         */
        function setNamespaces( $namespaces ) {
                $this->namespaces = $namespaces;
@@ -287,7 +285,7 @@ class SearchEngine {
         * don't support building a suggestion in the first place and others don't respect
         * this flag.
         *
-        * @param boolean $showSuggestion should the searcher try to build suggestions
+        * @param bool $showSuggestion Should the searcher try to build suggestions
         */
        function setShowSuggestion( $showSuggestion ) {
                $this->showSuggestion = $showSuggestion;
@@ -297,7 +295,7 @@ class SearchEngine {
         * Parse some common prefixes: all (search everything)
         * or namespace names
         *
-        * @param $query String
+        * @param string $query
         * @return string
         */
        function replacePrefixes( $query ) {
@@ -332,7 +330,7 @@ class SearchEngine {
 
        /**
         * Make a list of searchable namespaces and their canonical names.
-        * @return Array
+        * @return array
         */
        public static function searchableNamespaces() {
                global $wgContLang;
@@ -351,8 +349,8 @@ class SearchEngine {
         * Extract default namespaces to search from the given user's
         * settings, returning a list of index numbers.
         *
-        * @param $user User
-        * @return Array
+        * @param user $user
+        * @return array
         */
        public static function userNamespaces( $user ) {
                global $wgSearchEverythingOnlyLoggedIn;
@@ -380,7 +378,7 @@ class SearchEngine {
        /**
         * Find snippet highlight settings for all users
         *
-        * @return Array contextlines, contextchars
+        * @return array Contextlines, contextchars
         */
        public static function userHighlightPrefs() {
                $contextlines = 2; // Hardcode this. Old defaults sucked. :)
@@ -391,7 +389,7 @@ class SearchEngine {
        /**
         * An array of namespaces indexes to be searched by default
         *
-        * @return Array
+        * @return array
         */
        public static function defaultNamespaces() {
                global $wgNamespacesToBeSearchedDefault;
@@ -403,7 +401,7 @@ class SearchEngine {
         * Get a list of namespace names useful for showing in tooltips
         * and preferences
         *
-        * @param $namespaces Array
+        * @param array $namespaces
         * @return array
         */
        public static function namespacesAsText( $namespaces ) {
@@ -421,7 +419,7 @@ class SearchEngine {
        /**
         * Return the help namespaces to be shown on Special:Search
         *
-        * @return Array
+        * @return array
         */
        public static function helpNamespaces() {
                global $wgNamespacesToBeSearchedHelp;
@@ -432,8 +430,8 @@ class SearchEngine {
        /**
         * Return a 'cleaned up' search string
         *
-        * @param $text String
-        * @return String
+        * @param string $text
+        * @return string
         */
        function filter( $text ) {
                $lc = $this->legalSearchChars();
@@ -444,7 +442,7 @@ class SearchEngine {
         * Load up the appropriate search engine class for the currently
         * active database backend, and return a configured instance.
         *
-        * @param String $type Type of search backend, if not the default
+        * @param string $type Type of search backend, if not the default
         * @return SearchEngine
         */
        public static function create( $type = null ) {
@@ -486,9 +484,9 @@ class SearchEngine {
         * Title and text should be pre-processed.
         * STUB
         *
-        * @param $id Integer
-        * @param $title String
-        * @param $text String
+        * @param int $id
+        * @param string $title
+        * @param string $text
         */
        function update( $id, $title, $text ) {
                // no-op
@@ -499,8 +497,8 @@ class SearchEngine {
         * Title should be pre-processed.
         * STUB
         *
-        * @param $id Integer
-        * @param $title String
+        * @param int $id
+        * @param string $title
         */
        function updateTitle( $id, $title ) {
                // no-op
@@ -511,8 +509,8 @@ class SearchEngine {
         * Title should be pre-processed.
         * STUB
         *
-        * @param Integer $id Page id that was deleted
-        * @param String $title Title of page that was deleted
+        * @param int $id Page id that was deleted
+        * @param string $title Title of page that was deleted
         */
        function delete( $id, $title ) {
                // no-op
@@ -521,7 +519,7 @@ class SearchEngine {
        /**
         * Get OpenSearch suggestion template
         *
-        * @return String
+        * @return string
         */
        public static function getOpenSearchTemplate() {
                global $wgOpenSearchTemplate, $wgCanonicalServer;