TitleFactory::newFromText()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
namespace SubPageList;
4
5
use Title;
6
7
/**
8
 * Factory to construct Title objects.
9
 *
10
 * This avoids the need to have static calls from all the code that
11
 * needs to construct a Title, and thus allows for looser coupling.
12
 *
13
 * @since 1.0
14
 *
15
 * @licence GNU GPL v2+
16
 * @author Jeroen De Dauw < [email protected] >
17
 */
18
class TitleFactory {
19
20
	/**
21
	 * @param string $text
22
	 * @param int $defaultNamespace
23
	 *
24
	 * @return null|Title
25
	 */
26 23
	public function newFromText( $text, $defaultNamespace = NS_MAIN ) {
27 23
		return Title::newFromText( $text, $defaultNamespace );
28
	}
29
30
}
31