mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-09-03 23:06:57 +02:00
Compare commits
5 Commits
main
...
b55f6ea5c1
Author | SHA1 | Date | |
---|---|---|---|
b55f6ea5c1 | |||
9ec3c49f50 | |||
255a5ca9a8 | |||
05030e02ba | |||
87de424161 |
@@ -25,14 +25,14 @@
|
|||||||
namespace LinkTitles;
|
namespace LinkTitles;
|
||||||
|
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
|
use MediaWiki\Title\Title as MWTitle;
|
||||||
/**
|
/**
|
||||||
* Represents a page that is a potential link target.
|
* Represents a page that is a potential link target.
|
||||||
*/
|
*/
|
||||||
class Target {
|
class Target {
|
||||||
/**
|
/**
|
||||||
* A Title object for the target page currently being examined.
|
* A Title object for the target page currently being examined.
|
||||||
* @var \Title $title
|
* @var MediaWiki\Title\Title $title
|
||||||
*/
|
*/
|
||||||
private $title;
|
private $title;
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ class Target {
|
|||||||
* @param String &$title Title of the target page
|
* @param String &$title Title of the target page
|
||||||
*/
|
*/
|
||||||
public function __construct( $namespace, $title, Config &$config ) {
|
public function __construct( $namespace, $title, Config &$config ) {
|
||||||
$this->title = \Title::makeTitleSafe( $namespace, $title );
|
$this->title = MWTitle::makeTitleSafe( $namespace, $title );
|
||||||
$this->titleValue = $this->title->getTitleValue();
|
$this->titleValue = $this->title->getTitleValue();
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ class Targets {
|
|||||||
* @param String $sourceNamespace The namespace of the current page.
|
* @param String $sourceNamespace The namespace of the current page.
|
||||||
* @param Config $config LinkTitles configuration.
|
* @param Config $config LinkTitles configuration.
|
||||||
*/
|
*/
|
||||||
public static function singleton( \Title $title, Config $config ) {
|
public static function singleton( \MediaWiki\Title\Title $title, Config $config ) {
|
||||||
if ( ( self::$instance === null ) || ( self::$instance->sourceNamespace != $title->getNamespace() ) ) {
|
if ( ( self::$instance === null ) || ( self::$instance->sourceNamespace != $title->getNamespace() ) ) {
|
||||||
self::$instance = new Targets( $title, $config );
|
self::$instance = new Targets( $title, $config );
|
||||||
}
|
}
|
||||||
@@ -85,9 +85,9 @@ class Targets {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor is private to enforce using the singleton pattern.
|
* The constructor is private to enforce using the singleton pattern.
|
||||||
* @param \Title $title
|
* @param Mediawiki\Title\Title $title
|
||||||
*/
|
*/
|
||||||
private function __construct( \Title $title, Config $config) {
|
private function __construct( \MediaWiki\Title\Title $title, Config $config) {
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->sourceNamespace = $title->getNamespace();
|
$this->sourceNamespace = $title->getNamespace();
|
||||||
$this->fetch();
|
$this->fetch();
|
||||||
|
Reference in New Issue
Block a user