PluginProbe
WPIDE – File Manager & Code Editor / 2.2
WPIDE – File Manager & Code Editor v2.2
3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 3.4 All 54 releases
wpide / PHP-Parser / lib / PHPParser / Error.php

Error.php in WPIDE – File Manager & Code Editor 2.2, at PHP-Parser/lib/PHPParser/Error.php

70 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class PHPParser_Error extends RuntimeException
4 {
5 protected $rawMessage;
6 protected $rawLine;
7
8 /**
9 * Creates an Exception signifying a parse error.
10 *
11 * @param string $message Error message
12 * @param int $line Error line in PHP file
13 */
14 public function __construct($message, $line = -1) {
15 $this->rawMessage = (string) $message;
16 $this->rawLine = (int) $line;
17 $this->updateMessage();
18 }
19
20 /**
21 * Gets the error message
22 *
23 * @return string Error message
24 */
25 public function getRawMessage() {
26 return $this->rawMessage;
27 }
28
29 /**
30 * Sets the line of the PHP file the error occurred in.
31 *
32 * @param string $message Error message
33 */
34 public function setRawMessage($message) {
35 $this->rawMessage = (string) $message;
36 $this->updateMessage();
37 }
38
39 /**
40 * Gets the error line in the PHP file.
41 *
42 * @return int Error line in the PHP file
43 */
44 public function getRawLine() {
45 return $this->rawLine;
46 }
47
48 /**
49 * Sets the line of the PHP file the error occurred in.
50 *
51 * @param int $line Error line in the PHP file
52 */
53 public function setRawLine($line) {
54 $this->rawLine = (int) $line;
55 $this->updateMessage();
56 }
57
58 /**
59 * Updates the exception message after a change to rawMessage or rawLine.
60 */
61 protected function updateMessage() {
62 $this->message = $this->rawMessage;
63
64 if (-1 === $this->rawLine) {
65 $this->message .= ' on unknown line';
66 } else {
67 $this->message .= ' on line ' . $this->rawLine;
68 }
69 }
70 }