Beispiel #1
0
 protected function createPointcutContext(TypeInfoInterface $type, MethodInfoInterface $method)
 {
     $context = new PointcutContext($type->getNamespaceContext());
     foreach ($method->getParameters() as $param) {
         $context->addParam($param->getName(), $param->getRequiredType());
     }
     foreach ($method->getAnnotationCandidates() as $anno) {
         $context->addAnnotation($anno);
     }
     return $context;
 }
Beispiel #2
0
 protected function getInfoSignature(MethodInfoInterface $method)
 {
     return sprintf('%s->%s()', $method->getDeclaringType()->getName(), $method->getName());
 }
Beispiel #3
0
 public function buildMethodSignature(MethodInfoInterface $method, $skipAbstract = false)
 {
     $code = '';
     if ($method->isProtected()) {
         $code .= 'protected ';
     } elseif ($method->isPrivate()) {
         $code .= 'private ';
     } else {
         $code .= 'public ';
     }
     if ($method->isStatic()) {
         $code .= 'static ';
     }
     if ($method->isAbstract() && !$skipAbstract) {
         $code .= 'abstract ';
     } elseif ($method->isFinal()) {
         $code .= 'final ';
     }
     $code .= 'function ';
     if ($method->isReturnReference()) {
         $code .= '& ';
     }
     $code .= $method->getName() . '(';
     foreach ($method->getParameters() as $i => $param) {
         if ($i != 0) {
             $code .= ', ';
         }
         $code .= $this->buildParameterSignature($param);
     }
     return $code . ')';
 }