protected getJoinpointInvocationBody ( ReflectionMethod $method ) : string | ||
$method | ReflectionMethod | Method reflection |
return | string | new method body |
protected function getJoinpointInvocationBody(ReflectionMethod $method)
{
$isStatic = $method->isStatic();
$scope = $isStatic ? self::$staticLsbExpression : '$this';
$prefix = $isStatic ? AspectContainer::STATIC_METHOD_PREFIX : AspectContainer::METHOD_PREFIX;
$args = $this->prepareArgsLine($method);
$body = '';
if (!empty($args)) {
$scope = "{$scope}, {$args}";
}
$body .= "return self::\$__joinPoints['{$prefix}:{$method->name}']->__invoke({$scope});";
return $body;
}