Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| MhchemRegExp | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRegExp | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Copyright (c) 2023 Johannes Stegmüller |
| 4 | * |
| 5 | * This file is a port of mhchemParser originally authored by Martin Hensel in javascript/typescript. |
| 6 | * The original license for this software can be found in the accompanying LICENSE.mhchemParser-ts.txt file. |
| 7 | */ |
| 8 | |
| 9 | namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem; |
| 10 | |
| 11 | /** |
| 12 | * Wrapper class to declare a hardcoded string to a regular expression. |
| 13 | * @author Johannes Stegmüller |
| 14 | * @license GPL-2.0-or-later |
| 15 | */ |
| 16 | class MhchemRegExp { |
| 17 | |
| 18 | /** @var string regular expression pattern as a string */ |
| 19 | private string $regexp; |
| 20 | |
| 21 | /** |
| 22 | * Utility class to distinguish Regular expression strings defined in |
| 23 | * the codebase of mhchemParser from regular strings. |
| 24 | * @param string $pattern regular expression pattern, usually of the format "/regexp/" |
| 25 | */ |
| 26 | public function __construct( string $pattern ) { |
| 27 | $this->regexp = $pattern; |
| 28 | } |
| 29 | |
| 30 | public function getRegExp(): string { |
| 31 | return $this->regexp; |
| 32 | } |
| 33 | } |