forked from wikimedia/mediawiki-extensions-Math
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MathInputCheck.php
53 lines (49 loc) · 1.08 KB
/
MathInputCheck.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* MediaWiki math extension
*
* (c) 2002-2014 Tomasz Wegrzanowski, Brion Vibber, Moritz Schubotz,
* and other MediaWiki contributors
*
* GPLv2 license; info in main package.
*
* @author Moritz Schubotz
*/
abstract class MathInputCheck {
protected $inputTeX;
protected $validTeX;
protected $isValid = false;
protected $lastError = null;
/**
* Default constructor
* (performs no checking)
* @param String $tex the TeX InputString to be checked
*/
public function __construct( $tex = '' ) {
$this->inputTeX = $tex;
$this->isValid = false;
}
/**
* Returns true if the TeX input String is valid
* @return boolean
*/
public function isValid() {
return $this->isValid;
}
/**
* Returns the string of the last error.
* @return string
*/
public function getError() {
return $this->lastError;
}
/**
* Some TeX checking programs may return
* a modified tex string after having checked it.
* You can get the altered tex string with this method
* @return string A valid Tex string
*/
public function getValidTex() {
return $this->validTeX;
}
}