]> khamidou — GitHub mirrors - arcanist.git/commit
Add a linter rule to prevent exceptions from being thrown in a toString method
authorJoshua Spence <josh@joshuaspence.com>
Sun, 17 May 2015 22:17:32 +0000 (08:17 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 17 May 2015 22:18:34 +0000 (08:18 +1000)
commit1e3073a4f88e92159f797e34c716fd09ad17d7fa
tree08c5e9a43f8fa7abeae0a450f1571d58755fd0d0
parent2e66d03c68e470748aea87960402b94285cf19d0
Add a linter rule to prevent exceptions from being thrown in a toString method

Summary: Fixes T8207. It is not possible to throw an exception from within the `__toString()` method. Add a linter rule to prevent this from happening.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8207

Differential Revision: https://secure.phabricator.com/D12854
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/xhpast/tostring-exception.lint-test [new file with mode: 0644]