/var/www/vhosts/ihelp.ro/httpdocs/vendor/nikic/php-parser/lib/PhpParser
NameSizeModeActions
Builder/-0755rm
Comment/-0755rm
ErrorHandler/-0755rm
Internal/-0755rm
Lexer/-0755rm
Node/-0755rm
NodeVisitor/-0755rm
Parser/-0755rm
PrettyPrinter/-0755rm
Builder.php2030644editdlrm
BuilderFactory.php111150644editdlrm
BuilderHelpers.php97650644editdlrm
Comment.php75460644editdlrm
ConstExprEvaluationException.php860644editdlrm
ConstExprEvaluator.php92700644editdlrm
Error.php50420644editdlrm
ErrorHandler.php2940644editdlrm
JsonDecoder.php33750644editdlrm
Lexer.php240790644editdlrm
NameContext.php99230644editdlrm
Node.php39750644editdlrm
NodeAbstract.php51480644editdlrm
NodeDumper.php68510644editdlrm
NodeFinder.php24520644editdlrm
NodeTraverser.php105920644editdlrm
NodeTraverserInterface.php6290644editdlrm
NodeVisitor.php20260644editdlrm
NodeVisitorAbstract.php4380644editdlrm
Parser.php6280644editdlrm
ParserAbstract.php422140644editdlrm
ParserFactory.php16140644editdlrm
PrettyPrinterAbstract.php639710644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/nikic/php-parser/lib/PhpParser/Error.php (5042B)
rawMessage = $message; if (is_array($attributes)) { $this->attributes = $attributes; } else { $this->attributes = ['startLine' => $attributes]; } $this->updateMessage(); } /** * Gets the error message * * @return string Error message */ public function getRawMessage() : string { return $this->rawMessage; } /** * Gets the line the error starts in. * * @return int Error start line */ public function getStartLine() : int { return $this->attributes['startLine'] ?? -1; } /** * Gets the line the error ends in. * * @return int Error end line */ public function getEndLine() : int { return $this->attributes['endLine'] ?? -1; } /** * Gets the attributes of the node/token the error occurred at. * * @return array */ public function getAttributes() : array { return $this->attributes; } /** * Sets the attributes of the node/token the error occurred at. * * @param array $attributes */ public function setAttributes(array $attributes) { $this->attributes = $attributes; $this->updateMessage(); } /** * Sets the line of the PHP file the error occurred in. * * @param string $message Error message */ public function setRawMessage(string $message) { $this->rawMessage = $message; $this->updateMessage(); } /** * Sets the line the error starts in. * * @param int $line Error start line */ public function setStartLine(int $line) { $this->attributes['startLine'] = $line; $this->updateMessage(); } /** * Returns whether the error has start and end column information. * * For column information enable the startFilePos and endFilePos in the lexer options. * * @return bool */ public function hasColumnInfo() : bool { return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); } /** * Gets the start column (1-based) into the line where the error started. * * @param string $code Source code of the file * @return int */ public function getStartColumn(string $code) : int { if (!$this->hasColumnInfo()) { throw new \RuntimeException('Error does not have column information'); } return $this->toColumn($code, $this->attributes['startFilePos']); } /** * Gets the end column (1-based) into the line where the error ended. * * @param string $code Source code of the file * @return int */ public function getEndColumn(string $code) : int { if (!$this->hasColumnInfo()) { throw new \RuntimeException('Error does not have column information'); } return $this->toColumn($code, $this->attributes['endFilePos']); } /** * Formats message including line and column information. * * @param string $code Source code associated with the error, for calculation of the columns * * @return string Formatted message */ public function getMessageWithColumnInfo(string $code) : string { return sprintf( '%s from %d:%d to %d:%d', $this->getRawMessage(), $this->getStartLine(), $this->getStartColumn($code), $this->getEndLine(), $this->getEndColumn($code) ); } /** * Converts a file offset into a column. * * @param string $code Source code that $pos indexes into * @param int $pos 0-based position in $code * * @return int 1-based column (relative to start of line) */ private function toColumn(string $code, int $pos) : int { if ($pos > strlen($code)) { throw new \RuntimeException('Invalid position information'); } $lineStartPos = strrpos($code, "\n", $pos - strlen($code)); if (false === $lineStartPos) { $lineStartPos = -1; } return $pos - $lineStartPos; } /** * Updates the exception message after a change to rawMessage or rawLine. */ protected function updateMessage() { $this->message = $this->rawMessage; if (-1 === $this->getStartLine()) { $this->message .= ' on unknown line'; } else { $this->message .= ' on line ' . $this->getStartLine(); } } }