restbaseInterface = $ref; } else { $this->restbaseInterface = new MathRestbaseInterface( $tex, $type ); $ref = $this->restbaseInterface; } } /** * @return bool */ public function isValid() { return $this->restbaseInterface->getSuccess(); } /** * 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(): ?string { return $this->restbaseInterface->getCheckedTex(); } /** * Returns the string of the last error. * @return ?Message */ public function getError(): ?Message { $err = $this->restbaseInterface->getError(); if ( $err === null ) { return null; } try { $host = $this->restbaseInterface->getUrl( '' ); } catch ( Exception $ignore ) { $host = 'invalid'; } return $this->errorObjectToMessage( $err, $host ); } public function getRbi(): MathRestbaseInterface { return $this->restbaseInterface; } }