comparison vendor/nikic/php-parser/lib/PhpParser/Error.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
13 * @param string $message Error message 13 * @param string $message Error message
14 * @param array|int $attributes Attributes of node/token where error occurred 14 * @param array|int $attributes Attributes of node/token where error occurred
15 * (or start line of error -- deprecated) 15 * (or start line of error -- deprecated)
16 */ 16 */
17 public function __construct(string $message, $attributes = []) { 17 public function __construct(string $message, $attributes = []) {
18 $this->rawMessage = (string) $message; 18 $this->rawMessage = $message;
19 if (is_array($attributes)) { 19 if (is_array($attributes)) {
20 $this->attributes = $attributes; 20 $this->attributes = $attributes;
21 } else { 21 } else {
22 $this->attributes = ['startLine' => $attributes]; 22 $this->attributes = ['startLine' => $attributes];
23 } 23 }
74 * Sets the line of the PHP file the error occurred in. 74 * Sets the line of the PHP file the error occurred in.
75 * 75 *
76 * @param string $message Error message 76 * @param string $message Error message
77 */ 77 */
78 public function setRawMessage(string $message) { 78 public function setRawMessage(string $message) {
79 $this->rawMessage = (string) $message; 79 $this->rawMessage = $message;
80 $this->updateMessage(); 80 $this->updateMessage();
81 } 81 }
82 82
83 /** 83 /**
84 * Sets the line the error starts in. 84 * Sets the line the error starts in.
85 * 85 *
86 * @param int $line Error start line 86 * @param int $line Error start line
87 */ 87 */
88 public function setStartLine(int $line) { 88 public function setStartLine(int $line) {
89 $this->attributes['startLine'] = (int) $line; 89 $this->attributes['startLine'] = $line;
90 $this->updateMessage(); 90 $this->updateMessage();
91 } 91 }
92 92
93 /** 93 /**
94 * Returns whether the error has start and end column information. 94 * Returns whether the error has start and end column information.