SearchNearMatchResultSet   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A numRows() 0 3 2
A next() 0 7 3
A rewind() 0 3 1
1
<?php
2
/**
3
 * A SearchResultSet wrapper for SearchNearMatcher
4
 */
5
class SearchNearMatchResultSet extends SearchResultSet {
6
	private $fetched = false;
7
8
	/**
9
	 * @param Title|null $match Title if matched, else null
10
	 */
11
	public function __construct( $match ) {
12
		$this->result = $match;
0 ignored issues
show
Bug introduced by
The property result does not seem to exist. Did you mean results?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
13
	}
14
15
	public function numRows() {
16
		return $this->result ? 1 : 0;
0 ignored issues
show
Bug introduced by
The property result does not seem to exist. Did you mean results?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
17
	}
18
19
	public function next() {
20
		if ( $this->fetched || !$this->result ) {
0 ignored issues
show
Bug introduced by
The property result does not seem to exist. Did you mean results?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
21
			return false;
22
		}
23
		$this->fetched = true;
24
		return SearchResult::newFromTitle( $this->result, $this );
0 ignored issues
show
Bug introduced by
The property result does not seem to exist. Did you mean results?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
25
	}
26
27
	public function rewind() {
28
		$this->fetched = false;
29
	}
30
}
31