From: Joshua Spence Date: Sun, 22 Jun 2014 15:56:44 +0000 (+1000) Subject: Improve the handling of the `php_compat_info.json` file. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=990027e3e04c17a085897f2df46d9d6994c9cdc5;p=arcanist.git Improve the handling of the `php_compat_info.json` file. Summary: See inline comments on D9576. Also replace `json_decode` with `phutil_json_decode`, for better error handling. Test Plan: Make sure `arc unit` still works. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9656 --- diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index b09d50cb..514f309c 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -394,7 +394,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { $target = phutil_get_library_root('arcanist'). '/../resources/php_compat_info.json'; - $compat_info = json_decode(file_get_contents($target), true); + $compat_info = phutil_json_decode(Filesystem::readFile($target)); $calls = $root->selectDescendantsOfType('n_FUNCTION_CALL'); foreach ($calls as $call) {