Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15364014
D13695.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
837 B
Referenced Files
None
Subscribers
None
D13695.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 12:56 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7577565
Default Alt Text
D13695.diff (837 B)
Attached To
Mode
D13695: Improve strictness around `setLine()` types in ArcanistLintMessage
Attached
Detach File
Event Timeline
Log In to Comment