Example #1
0
 /**
  * @param int|null $code
  * @param string $value
  *
  * @return string
  */
 public function transform($code, $value)
 {
     if ($value === '}') {
         $this->getTransformer()->setMode(Transformer::MODE_FILE);
     } else {
         switch ($code) {
             case T_STATIC:
                 $this->static = true;
                 break;
             case T_PUBLIC:
             case T_PROTECTED:
             case T_PRIVATE:
                 $this->visibility = $code;
                 break;
             case T_ABSTRACT:
             case T_FINAL:
                 $this->attribute = $code;
                 break;
             case T_VARIABLE:
                 $this->reset();
                 break;
             case T_FUNCTION:
                 $method = new MethodMetaInfo();
                 $method->setIsStatic($this->static);
                 $method->setAttribute($this->attribute);
                 $method->setVisibility($this->visibility);
                 $this->getTransformer()->getClassMetaInfo()->addMethod($method);
                 $this->getTransformer()->setMode($code);
                 $this->reset();
                 break;
         }
     }
     return $value;
 }