From 990027e3e04c17a085897f2df46d9d6994c9cdc5 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 23 Jun 2014 01:56:44 +1000 Subject: [PATCH] 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 --- src/lint/linter/ArcanistXHPASTLinter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {