X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FTitleArray.php;h=895b5a76b6e154096c9c267d29dedb3d07b2647d;hp=a1eabe5b25504e25c8b27742e41a278fa23560ba;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hpb=c2f9376c19335219d403e602496fa44f4a3e7b55 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 ); } }