X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiRevisionDelete.php;h=9a793e2f99200953fcc94dedcb536cb386c25c6f;hb=3fedcc76716b2fd15e8b992d5c72b848d891b5f7;hp=4580aa213e162fcdeeec42611235046d041e98da;hpb=2ffff73a46c29cdad1cbf59063f4dd75debd3b4c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiRevisionDelete.php b/includes/api/ApiRevisionDelete.php index 4580aa213e..9a793e2f99 100644 --- a/includes/api/ApiRevisionDelete.php +++ b/includes/api/ApiRevisionDelete.php @@ -1,8 +1,6 @@ + * Copyright © 2013 Wikimedia Foundation and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +45,7 @@ class ApiRevisionDelete extends ApiBase { } // Check if user can add tags - if ( count( $params['tags'] ) ) { + if ( $params['tags'] ) { $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); if ( !$ableToTag->isOK() ) { $this->dieStatus( $ableToTag ); @@ -116,11 +114,10 @@ class ApiRevisionDelete extends ApiBase { } $list->reloadFromMaster(); - // @codingStandardsIgnoreStart Avoid function calls in a FOR loop test part + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $item = $list->reset(); $list->current(); $item = $list->next() ) { $data['items'][$item->getId()] += $item->getApiData( $this->getResult() ); } - // @codingStandardsIgnoreEnd $data['items'] = array_values( $data['items'] ); ApiResult::setIndexedTagName( $data['items'], 'i' );