]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix phutil_analyzer bug on interface dependency creation
authorFelipe Oliveira Carvalho <felipekde@gmail.com>
Wed, 10 Aug 2011 14:50:10 +0000 (11:50 -0300)
committerFelipe Oliveira Carvalho <felipekde@gmail.com>
Wed, 10 Aug 2011 15:01:30 +0000 (12:01 -0300)
Summary:
Use $interface_name instead of $class_name when dealing with
interfaces. Problem happens when you extend an interface:

    interface SubIface extends SuperIface { ...

    Notice: Undefined variable: class_name in ...
Fatal error: Call to a member function getConcreteString() on a
non-object in ...

Test Plan: phutil_mapper.php works!

scripts/phutil_analyzer.php

index 91b253dcfef1bc182f0125bfabf2544c0eed3eac..c11b75d4ac1d98c8b5670774baf326b9c5a7fc7a 100755 (executable)
@@ -303,7 +303,7 @@ foreach (Futures($futures) as $file => $future) {
       $extends = $interface->getChildByIndex(2);
       foreach ($extends->selectDescendantsOfType('n_CLASS_NAME') as $parent) {
         $requirements->addInterfaceDependency(
-          $class_name->getConcreteString(),
+          $interface_name->getConcreteString(),
           $parent,
           $parent->getConcreteString());
       }