protected function getJoinpointInvocationBody(ReflectionMethod $method): string
    {
        $isStatic = $method->isStatic();
        $scope    = $isStatic ? 'static::class' : '$this';
        $prefix   = $isStatic ? AspectContainer::STATIC_METHOD_PREFIX : AspectContainer::METHOD_PREFIX;

        $argumentList = new FunctionCallArgumentListGenerator($method);
        $argumentCode = $argumentList->generate();
        $return = 'return ';
        if ($method->hasReturnType()) {
            $returnType = (string) $method->getReturnType();
            if ($returnType === 'void') {
                // void return types should not return anything
                $return = '';
            }
        }

        if (!empty($argumentCode)) {
            $scope = "$scope, $argumentCode";
        }

        $body = "{$return}self::\$__joinPoints['{$prefix}:{$method->name}']->__invoke($scope);";

        return $body;
    }
protected function getJoinpointInvocationBody(ReflectionMethod $method): string
    {
        $isStatic = $method->isStatic();
        $scope    = $isStatic ? 'static::class' : '$this';
        $prefix   = $isStatic ? AspectContainer::STATIC_METHOD_PREFIX : AspectContainer::METHOD_PREFIX;

        $argumentList = new FunctionCallArgumentListGenerator($method);
        $argumentCode = $argumentList->generate();
        $return = 'return ';
        if ($method->hasReturnType()) {
            $returnType = (string) $method->getReturnType();
            if ($returnType === 'void') {
                // void return types should not return anything
                $return = '';
            }
        }

        if (!empty($argumentCode)) {
            $scope = "$scope, $argumentCode";
        }

        $body = "{$return}self::\$__joinPoints['{$prefix}:{$method->name}']->__invoke($scope);";

        return $body;
    }
protected function getJoinpointInvocationBody ( ReflectionMethod $ method ) : string { $ isStatic = $ method -> isStatic ( ) ; $ scope = $ isStatic ? 'static::class' : '$this' ; $ prefix = $ isStatic ? AspectContainer :: STATIC_METHOD_PREFIX : AspectContainer :: METHOD_PREFIX ; $ argumentList = new FunctionCallArgumentListGenerator ( $ method ) ; $ argumentCode = $ argumentList -> generate ( ) ; $ return = 'return ' ; if ( $ method -> hasReturnType ( ) ) { $ returnType = ( string ) $ method -> getReturnType ( ) ; if ( $ returnType === 'void' ) { // void return types should not return anything $ return = '' ; } } if ( ! empty ( $ argumentCode ) ) { $ scope = "$scope, $argumentCode" ; } $ body = "{$return}self::\$__joinPoints['{$prefix}:{$method->name}']->__invoke($scope);" ; return $ body ; }
Creates string definition for method body by method reflection
Creates string definition for method body by method reflection