Page MenuHomePhabricator

D13695.diff
No OneTemporary

D13695.diff

diff --git a/src/lint/ArcanistLintMessage.php b/src/lint/ArcanistLintMessage.php
--- a/src/lint/ArcanistLintMessage.php
+++ b/src/lint/ArcanistLintMessage.php
@@ -72,6 +72,23 @@
}
public function setLine($line) {
+ if ($line === null) {
+ // This just means that we don't have any line information.
+ } else {
+ // For compatibility, accept digit strings since a lot of linters pass
+ // line numbers that they have parsed from command output or XML, which
+ // won't be properly typed.
+ if (is_string($line) && preg_match('/^\d+\z/', $line)) {
+ $line = (int)$line;
+ }
+
+ if (!is_int($line)) {
+ throw new Exception(
+ pht(
+ 'Parameter passed to setLine() must be an integer.'));
+ }
+ }
+
$this->line = $line;
return $this;
}

File Metadata

Mime Type
text/plain
Expires
Mon, May 13, 2:58 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6274470
Default Alt Text
D13695.diff (837 B)

Event Timeline