X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitleArray.php;h=895b5a76b6e154096c9c267d29dedb3d07b2647d;hb=5485a3dda0b188b2ff4d8d90476437215ecb9442;hp=a1eabe5b25504e25c8b27742e41a278fa23560ba;hpb=c004cfc116eb8c677c346f3db561fc3593a8fd99;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/TitleArray.php b/includes/TitleArray.php index a1eabe5b25..895b5a76b6 100644 --- a/includes/TitleArray.php +++ b/includes/TitleArray.php @@ -29,6 +29,8 @@ use Wikimedia\Rdbms\IResultWrapper; /** * The TitleArray class only exists to provide the newFromResult method at pre- * sent. + * + * @method int count() */ abstract class TitleArray implements Iterator { /** @@ -42,18 +44,6 @@ abstract class TitleArray implements Iterator { if ( !Hooks::run( 'TitleArrayFromResult', [ &$array, $res ] ) ) { return null; } - if ( $array === null ) { - $array = self::newFromResult_internal( $res ); - } - return $array; - } - - /** - * @param IResultWrapper $res - * @return TitleArrayFromResult - */ - protected static function newFromResult_internal( $res ) { - $array = new TitleArrayFromResult( $res ); - return $array; + return $array ?? new TitleArrayFromResult( $res ); } }