Cast API timeSpentBackend to an int
[lhc/web/wiklou.git] / includes / api / ApiOpenSearch.php
index 15aa983..effa520 100644 (file)
@@ -190,7 +190,7 @@ class ApiOpenSearch extends ApiBase {
                        }
                } else {
                        foreach ( $titles as $title ) {
-                               $resultId = $title->getArticleId();
+                               $resultId = $title->getArticleID();
                                if ( $resultId === 0 ) {
                                        $resultId = $nextSpecialPageId;
                                        $nextSpecialPageId -= 1;
@@ -201,7 +201,7 @@ class ApiOpenSearch extends ApiBase {
                                        'extract' => false,
                                        'extract trimmed' => false,
                                        'image' => false,
-                                       'url' => wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ),
+                                       'url' => wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ),
                                ];
                        }
                }
@@ -338,8 +338,7 @@ class ApiOpenSearch extends ApiBase {
                        return trim( $matches[1] );
                } else {
                        // Just return the first line
-                       $lines = explode( "\n", $text );
-                       return trim( $lines[0] );
+                       return trim( explode( "\n", $text )[0] );
                }
        }
 
@@ -359,7 +358,7 @@ class ApiOpenSearch extends ApiBase {
 
                $ns = implode( '|', SearchEngine::defaultNamespaces() );
                if ( !$ns ) {
-                       $ns = "0";
+                       $ns = '0';
                }
 
                switch ( $type ) {