SearchEngine: Hard deprecate unused static methods deprecated in 1.27
[lhc/web/wiklou.git] / includes / search / SearchEngine.php
index 4cba19e..3e3f96c 100644 (file)
@@ -56,16 +56,16 @@ abstract class SearchEngine {
        /** @var array Feature values */
        protected $features = [];
 
-       /** @const string profile type for completionSearch */
+       /** Profile type for completionSearch */
        const COMPLETION_PROFILE_TYPE = 'completionSearchProfile';
 
-       /** @const string profile type for query independent ranking features */
+       /** Profile type for query independent ranking features */
        const FT_QUERY_INDEP_PROFILE_TYPE = 'fulltextQueryIndepProfile';
 
-       /** @const int flag for legalSearchChars: includes all chars allowed in a search query */
+       /** Integer flag for legalSearchChars: includes all chars allowed in a search query */
        const CHARS_ALL = 1;
 
-       /** @const int flag for legalSearchChars: includes all chars allowed in a search term */
+       /** Integer flag for legalSearchChars: includes all chars allowed in a search term */
        const CHARS_NO_SYNTAX = 2;
 
        /**
@@ -276,17 +276,18 @@ abstract class SearchEngine {
         * @return Title
         */
        public static function getNearMatch( $searchterm ) {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return static::defaultNearMatcher()->getNearMatch( $searchterm );
        }
 
        /**
         * Get chars legal for search
-        * NOTE: usage as static is deprecated and preserved only as BC measure
         * @param int $type type of search chars (see self::CHARS_ALL
         * and self::CHARS_NO_SYNTAX). Defaults to CHARS_ALL
         * @return string
         */
-       public static function legalSearchChars( $type = self::CHARS_ALL ) {
+       public function legalSearchChars( $type = self::CHARS_ALL ) {
                return "A-Za-z_'.0-9\\x80-\\xFF\\-";
        }
 
@@ -311,7 +312,7 @@ abstract class SearchEngine {
        function setNamespaces( $namespaces ) {
                if ( $namespaces ) {
                        // Filter namespaces to only keep valid ones
-                       $validNs = $this->searchableNamespaces();
+                       $validNs = MediaWikiServices::getInstance()->getSearchEngineConfig()->searchableNamespaces();
                        $namespaces = array_filter( $namespaces, function ( $ns ) use( $validNs ) {
                                return $ns < 0 || isset( $validNs[$ns] );
                        } );
@@ -736,6 +737,8 @@ abstract class SearchEngine {
         * @return array
         */
        public static function searchableNamespaces() {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineConfig()->searchableNamespaces();
        }
 
@@ -747,6 +750,8 @@ abstract class SearchEngine {
         * @return array
         */
        public static function userNamespaces( $user ) {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineConfig()->userNamespaces( $user );
        }
 
@@ -756,6 +761,8 @@ abstract class SearchEngine {
         * @return array
         */
        public static function defaultNamespaces() {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineConfig()->defaultNamespaces();
        }
 
@@ -767,6 +774,8 @@ abstract class SearchEngine {
         * @return array
         */
        public static function namespacesAsText( $namespaces ) {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineConfig()->namespacesAsText( $namespaces );
        }
 
@@ -778,6 +787,8 @@ abstract class SearchEngine {
         * @return SearchEngine
         */
        public static function create( $type = null ) {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineFactory()->create( $type );
        }
 
@@ -788,6 +799,8 @@ abstract class SearchEngine {
         * @return array
         */
        public static function getSearchTypes() {
+               wfDeprecated( __METHOD__, '1.27' );
+
                return MediaWikiServices::getInstance()->getSearchEngineConfig()->getSearchTypes();
        }