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