src/CodeGeneration/ReflectionHelper.php
public function getMethodBody(string $methodName, ReflectionClass $reflectionClass): string
    {
        $method      = $reflectionClass->getMethod($methodName);
        $startLine   = $method->getStartLine() - 1;
        $length      = $method->getEndLine() - $startLine;
        $lines       = file($reflectionClass->getFileName());
        $methodLines = \array_slice($lines, $startLine, $length);

        return implode('', $methodLines);
    }
public function getMethodBody(string $methodName, ReflectionClass $reflectionClass): string
    {
        $method      = $reflectionClass->getMethod($methodName);
        $startLine   = $method->getStartLine() - 1;
        $length      = $method->getEndLine() - $startLine;
        $lines       = file($reflectionClass->getFileName());
        $methodLines = \array_slice($lines, $startLine, $length);

        return implode('', $methodLines);
    }
public function getMethodBody ( string $ methodName , ReflectionClass $ reflectionClass ) : string { $ method = $ reflectionClass -> getMethod ( $ methodName ) ; $ startLine = $ method -> getStartLine ( ) - 1 ; $ length = $ method -> getEndLine ( ) - $ startLine ; $ lines = file ( $ reflectionClass -> getFileName ( ) ) ; $ methodLines = \ array_slice ( $ lines , $ startLine , $ length ) ; return implode ( '' , $ methodLines ) ; }
Get the full method body using reflection

@param string          $methodName
@param ReflectionClass $reflectionClass

@return string
Get the full method body using reflection