mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Do not use the reserved word default as function name.
This commit is contained in:
@ -76,8 +76,8 @@ class Linker {
|
||||
$limitReached = false;
|
||||
$newLinks = false; // whether or not new links were added
|
||||
$newText = $source->getText();
|
||||
$splitter = Splitter::default( $this->config );
|
||||
$targets = Targets::default( $source->getTitle(), $this->config );
|
||||
$splitter = Splitter::singleton( $this->config );
|
||||
$targets = Targets::singleton( $source->getTitle(), $this->config );
|
||||
|
||||
// Iterate through the target page titles
|
||||
foreach( $targets->queryResult as $row ) {
|
||||
|
@ -52,7 +52,7 @@ class Splitter {
|
||||
*
|
||||
* @param Config|null $config LinkTitles configuration.
|
||||
*/
|
||||
public static function default( Config &$config = null ) {
|
||||
public static function singleton( Config &$config = null ) {
|
||||
if ( self::$instance === null ) {
|
||||
if ( $config === null ) {
|
||||
$config = new Config();
|
||||
|
@ -40,7 +40,7 @@ class Targets {
|
||||
* @param String $sourceNamespace The namespace of the current page.
|
||||
* @param Config $config LinkTitles configuration.
|
||||
*/
|
||||
public static function default( \Title $title, Config $config ) {
|
||||
public static function singleton( \Title $title, Config $config ) {
|
||||
if ( ( self::$instance === null ) || ( self::$instance->sourceNamespace != $title->getNamespace() ) ) {
|
||||
self::$instance = new Targets( $title, $config );
|
||||
}
|
||||
@ -48,7 +48,7 @@ class Targets {
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the cache; the next call of Targets::default() will trigger
|
||||
* Invalidates the cache; the next call of Targets::singleton() will trigger
|
||||
* a database query.
|
||||
*
|
||||
* Use this in unit tests which are performed in a single request cycle so that
|
||||
|
Reference in New Issue
Block a user