Exemplo n.º 1
0
 protected function parseUse($match)
 {
     $use = new TUse();
     if (strpos($match, ' as ') !== false) {
         //Using alias
         $parts = explode(' as ', $match);
         $use->setClass($parts[0]);
         $use->setAlias($parts[1]);
     } else {
         preg_match("/.+\\\\(.+)/", $match, $matches);
         //get the class name, it becomes alias
         $alias = $matches[1];
         $use->setClass($match);
         $use->setAlias($alias);
     }
     $this->class->addUse($use);
 }
Exemplo n.º 2
0
 public function addUse(TUse $use)
 {
     $this->uses[$use->getAlias()] = $use;
 }