Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
LikeMatch | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikimedia\Rdbms; |
4 | |
5 | /** |
6 | * Used by Database::buildLike() to represent characters that have special |
7 | * meaning in SQL LIKE clauses and thus need no escaping. Don't instantiate it |
8 | * manually, use Database::anyChar() and anyString() instead. |
9 | */ |
10 | class LikeMatch { |
11 | /** @var string */ |
12 | private $str; |
13 | |
14 | /** |
15 | * Store a string into a LikeMatch marker object. |
16 | * |
17 | * @param string $s |
18 | */ |
19 | public function __construct( $s ) { |
20 | $this->str = $s; |
21 | } |
22 | |
23 | /** |
24 | * Return the original stored string. |
25 | * |
26 | * @return string |
27 | */ |
28 | public function toString() { |
29 | return $this->str; |
30 | } |
31 | } |