*/
namespace MediaWiki\Linker;
+use LinkCache;
use TitleFormatter;
use User;
*/
private $titleFormatter;
+ /**
+ * @var LinkCache
+ */
+ private $linkCache;
+
/**
* @param TitleFormatter $titleFormatter
+ * @param LinkCache $linkCache
*/
- public function __construct( TitleFormatter $titleFormatter ) {
+ public function __construct( TitleFormatter $titleFormatter, LinkCache $linkCache ) {
$this->titleFormatter = $titleFormatter;
+ $this->linkCache = $linkCache;
}
/**
* @return LinkRenderer
*/
public function create() {
- return new LinkRenderer( $this->titleFormatter );
+ return new LinkRenderer( $this->titleFormatter, $this->linkCache );
}
/**
public function createFromLegacyOptions( array $options ) {
$linkRenderer = $this->create();
- if ( in_array( 'noclasses', $options, true ) ) {
- $linkRenderer->setNoClasses( true );
- }
-
if ( in_array( 'forcearticlepath', $options, true ) ) {
$linkRenderer->setForceArticlePath( true );
}