Completed
Push — master ( 28f5b7...87cc9d )
by mw
10:20
created

ApprovedRevsFacade   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 45
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getApprovedRevID() 0 3 1
A hasApprovedRevision() 0 3 1
A getApprovedFileInfo() 0 3 1
A clearApprovedFileInfo() 0 3 1
1
<?php
2
3
namespace SMW\ApprovedRevs;
4
5
use Title;
6
use ApprovedRevs;
7
8
/**
9
 * The original `ApprovedRevs` consist of only static methods which are not mockable
10
 * or useful for any serious unit testing hence we use a facade to access an
11
 * instance.
12
 *
13
 * @license GNU GPL v2+
14
 * @since 1.0
15
 *
16
 * @author mwjames
17
 */
18
class ApprovedRevsFacade {
19
20
	/**
21
	 * @since 1.0
22
	 *
23
	 * @param Title $title
24
	 *
25
	 * @return integer|null
26
	 */
27 1
	public function getApprovedRevID( Title $title ) {
28 1
		return ApprovedRevs::getApprovedRevID( $title );
29
	}
30
31
	/**
32
	 * @since 1.0
33
	 *
34
	 * @param Title $title
35
	 *
36
	 * @return boolean
37
	 */
38 1
	public function hasApprovedRevision( Title $title ) {
39 1
		return ApprovedRevs::hasApprovedRevision( $title );
40
	}
41
42
	/**
43
	 * @since 1.0
44
	 *
45
	 * @param Title $title
46
	 *
47
	 * @return []
0 ignored issues
show
Documentation introduced by
The doc-type [] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
48
	 */
49 1
	public function getApprovedFileInfo( Title $title ) {
50 1
		return ApprovedRevs::getApprovedFileInfo( $title );
51
	}
52
53
	/**
54
	 * @since 1.0
55
	 *
56
	 * @param Title $title
57
	 */
58
	public function clearApprovedFileInfo( Title $title ) {
59
		unset( ApprovedRevs::$mApprovedFileInfo[ $title->getDBkey() ] );
60
	}
61
62
}
63