Conditions | 6 |
Paths | 5 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
51 | 2 | public function next() { |
|
52 | |||
53 | 2 | if ( $this->searchMatches === false || $this->searchMatches === array() ) { |
|
54 | 1 | return false; |
|
55 | } |
||
56 | |||
57 | 1 | if ( ( list( $key, $match ) = each( $this->searchMatches ) ) !== false ) { |
|
58 | |||
59 | 1 | if ( $match instanceOf SearchResult ) { |
|
60 | 1 | return $match; |
|
61 | } |
||
62 | |||
63 | 1 | if ( $match instanceOf Title ) { |
|
64 | 1 | return SearchResult::newFromTitle( $match ); |
|
65 | } |
||
66 | 1 | } |
|
67 | |||
68 | 1 | return false; |
|
69 | } |
||
70 | |||
112 |