Use (int) rather than intval()
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinks.php
index 35cb83a..f82a559 100644 (file)
@@ -187,7 +187,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        }
 
                        if ( is_null( $resultPageSet ) ) {
-                               $a = [ 'pageid' => intval( $row->page_id ) ];
+                               $a = [ 'pageid' => (int)$row->page_id ];
                                ApiQueryBase::addTitleInfo( $a, $t );
                                if ( $row->page_is_redirect ) {
                                        $a['redirect'] = true;
@@ -306,7 +306,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        }
 
                        if ( is_null( $resultPageSet ) ) {
-                               $a['pageid'] = intval( $row->page_id );
+                               $a['pageid'] = (int)$row->page_id;
                                ApiQueryBase::addTitleInfo( $a, Title::makeTitle( $row->page_namespace, $row->page_title ) );
                                if ( $row->page_is_redirect ) {
                                        $a['redirect'] = true;
@@ -336,7 +336,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        $this->params['limit'] = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
                        $result->addParsedLimit( $this->getModuleName(), $this->params['limit'] );
                } else {
-                       $this->params['limit'] = intval( $this->params['limit'] );
+                       $this->params['limit'] = (int)$this->params['limit'];
                        $this->validateLimit( 'limit', $this->params['limit'], 1, $userMax, $botMax );
                }
 
@@ -418,7 +418,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                if ( is_null( $resultPageSet ) ) {
                        // Try to add the result data in one go and pray that it fits
                        $code = $this->bl_code;
-                       $data = array_map( function ( $arr ) use ( $result, $code ) {
+                       $data = array_map( function ( $arr ) use ( $code ) {
                                if ( isset( $arr['redirlinks'] ) ) {
                                        $arr['redirlinks'] = array_values( $arr['redirlinks'] );
                                        ApiResult::setIndexedTagName( $arr['redirlinks'], $code );