/**
  * @param string $code
  * @return array
  */
 public function extractFromString($code)
 {
     $traverser = new NodeTraverser();
     $registry = new Registry();
     $traverser->addVisitor(new TrackedNameResolver($registry));
     try {
         $statements = $this->parser->parse($code);
         $traverser->traverse($statements);
     } catch (Error $e) {
         throw new RuntimeException('Parse Error: ', $e->getMessage());
     }
     $dependencies = $registry->getEntries();
     sort($dependencies);
     return $dependencies;
 }
 /**
  * @param $name
  */
 protected function addToRegistry($name)
 {
     if (!in_array(strtolower($name), $this->excludedNames)) {
         $this->registry->add($name);
     }
 }