Home GnuPG

Exclude variables used in strings inside closures when checking for undeclared…
9b8c9d280ea4Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

Exclude variables used in strings inside closures when checking for undeclared variables

Summary:
Improves upon D13795 to correctly handle variables within strings. Specifically, the following code currently (incorrectly) warns about $x being undeclared:

function some_func() {
  return function ($x) {
    echo "$x";
  };
}

It's worth noting that the situation would be improved if XHPAST properly parsed strings (see T8049).

Test Plan: Added test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

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

Details

Provenance
Joshua Spence <josh@freelancer.com>Authored on Aug 20 2015, 11:26 PM
Parents
rARCe56f326cf72e: Add a call to `assert_instances_of`
Branches
Unknown
Tags
Unknown

Event Timeline