HomePhabricator

Add a linter rule for incorrect use of parent scope

Description

Add a linter rule for incorrect use of parent scope

Summary:
The following code is invalid:

final class MyClass {
  public function __construct() {
    parent::__construct(null);
  }
}

$x = new MyClass();

Running the above code will produce a fatal error:

PHP Fatal error:  Cannot access parent:: when current class scope has no parent

Test Plan: Added unit tests.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: Korvin, epriestley

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

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on May 14 2015, 8:08 AM
Reviewer
Blessed Reviewers
Differential Revision
D12420: Add a linter rule for incorrect use of parent scope
Parents
rARCa6a26bb3a30a: Modernize `ArcanistPylintLinter`
Branches
Unknown
Tags
Unknown