dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a Status and a $reason parameter to TitleMove hook
[lhc/web/wiklou.git]
/
includes
/
MagicWordFactory.php
diff --git
a/includes/MagicWordFactory.php
b/includes/MagicWordFactory.php
index
11ed0a7
..
e62716d
100644
(file)
--- a/
includes/MagicWordFactory.php
+++ b/
includes/MagicWordFactory.php
@@
-192,8
+192,22
@@
class MagicWordFactory {
/** @var MagicWordArray */
private $mDoubleUnderscoreArray = null;
/** @var MagicWordArray */
private $mDoubleUnderscoreArray = null;
+ /** @var Language */
+ private $contLang;
+
/**#@-*/
/**#@-*/
+ /**
+ * @param Language $contLang Content language
+ */
+ public function __construct( Language $contLang ) {
+ $this->contLang = $contLang;
+ }
+
+ public function getContentLanguage() {
+ return $this->contLang;
+ }
+
/**
* Factory: creates an object representing an ID
*
/**
* Factory: creates an object representing an ID
*
@@
-203,7
+217,7
@@
class MagicWordFactory {
*/
public function get( $id ) {
if ( !isset( $this->mObjects[$id] ) ) {
*/
public function get( $id ) {
if ( !isset( $this->mObjects[$id] ) ) {
- $mw = new MagicWord();
+ $mw = new MagicWord(
null, [], false, $this->contLang
);
$mw->load( $id );
$this->mObjects[$id] = $mw;
}
$mw->load( $id );
$this->mObjects[$id] = $mw;
}
@@
-254,8
+268,18
@@
class MagicWordFactory {
public function getDoubleUnderscoreArray() {
if ( is_null( $this->mDoubleUnderscoreArray ) ) {
Hooks::run( 'GetDoubleUnderscoreIDs', [ &$this->mDoubleUnderscoreIDs ] );
public function getDoubleUnderscoreArray() {
if ( is_null( $this->mDoubleUnderscoreArray ) ) {
Hooks::run( 'GetDoubleUnderscoreIDs', [ &$this->mDoubleUnderscoreIDs ] );
- $this->mDoubleUnderscoreArray =
new MagicWord
Array( $this->mDoubleUnderscoreIDs );
+ $this->mDoubleUnderscoreArray =
$this->new
Array( $this->mDoubleUnderscoreIDs );
}
return $this->mDoubleUnderscoreArray;
}
}
return $this->mDoubleUnderscoreArray;
}
+
+ /**
+ * Get a new MagicWordArray with provided $names
+ *
+ * @param array $names
+ * @return MagicWordArray
+ */
+ public function newArray( array $names = [] ) : MagicWordArray {
+ return new MagicWordArray( $names, $this );
+ }
}
}