Page MenuHomePhabricator

`ArcanistXHPASTLinter` should allow classes/functions from a later version if they are used conditionally
Closed, ResolvedPublic

Description

Currently, linting src/future/http/HTTPSFuture.php from rPHU will raise the following error:

Error  (XHP31) Use Of PHP 5.3 Features
 This codebase targets PHP 5.2.3, but `curlfile` was not introduced until
 PHP 5.5.0.

          532       // use this "@" stuff.
          533 
          534       if (class_exists('CURLFile')) {
 >>>      535         $file_value = new CURLFile((string)$tmp, $info['mime'], $info['name']);
          536       } else {
          537         $file_value = '@'.(string)$tmp;
          538       }

However, since this class is being used conditionally, it should be fine and no linter errors should be being raised.

Event Timeline

joshuaspence claimed this task.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

XHPAST is probably powerful enough to handle this, but another possible attack on this is T1549.

joshuaspence lowered the priority of this task from Normal to Low.Jun 19 2014, 4:12 PM