mediawiki-extensions-Echo/includes/cache/TitleLocalCache.php
Derick Alangi f402ecd31f Echo: Fix case mismatch for function/method calls
PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.

Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
2019-06-11 22:46:24 +01:00

37 lines
606 B
PHP

<?php
/**
* Cache class that maps article id to Title object
*/
class EchoTitleLocalCache extends EchoLocalCache {
/**
* @var EchoTitleLocalCache
*/
private static $instance;
/**
* @return EchoTitleLocalCache
*/
public static function create() {
if ( !self::$instance ) {
self::$instance = new EchoTitleLocalCache();
}
return self::$instance;
}
/**
* @inheritDoc
*/
protected function resolve( array $lookups ) {
if ( $lookups ) {
$titles = Title::newFromIDs( $lookups );
foreach ( $titles as $title ) {
yield $title->getArticleID() => $title;
}
}
}
}