]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve the handling of the `php_compat_info.json` file.
authorJoshua Spence <josh@joshuaspence.com>
Sun, 22 Jun 2014 15:56:44 +0000 (01:56 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Sun, 22 Jun 2014 15:56:44 +0000 (01:56 +1000)
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

index b09d50cbd77aa27e846eb9b1ac7b2a72a2f6d8ee..514f309cd8060c69fe7f635dbc66a3b999275c14 100644 (file)
@@ -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) {