Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
StringCommentIterator | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
current | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\CommentFormatter; |
4 | |
5 | use ArrayIterator; |
6 | |
7 | /** |
8 | * An adaptor which converts an array of strings to an iterator of CommentItem |
9 | * objects. |
10 | * |
11 | * @since 1.38 |
12 | */ |
13 | class StringCommentIterator extends ArrayIterator { |
14 | /** |
15 | * @internal Use CommentBatch::strings() |
16 | * @param string[] $strings |
17 | */ |
18 | public function __construct( $strings ) { |
19 | parent::__construct( $strings ); |
20 | } |
21 | |
22 | public function current(): CommentItem { |
23 | return new CommentItem( parent::current() ); |
24 | } |
25 | } |