HomePhabricator

Allow classes/functions from a later version if they are used conditionally

Description

Allow classes/functions from a later version if they are used conditionally

Summary:
Fixes T5299. 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.

Test Plan: Added a test case.

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5299

Differential Revision: https://secure.phabricator.com/D10132