Return method statement

@return \PhpParser\Node\Stmt\ClassMethod
971741
private function getMethod(\ReflectionMethod $method)
    {
        $methodStmt = $this->factory->method($method->name);
        $params = $method->getParameters();
        foreach ($params as $param) {
            $methodStmt = $this->getMethodStatement($param, $methodStmt);
        }
        $returnType = $method->getReturnType();
        if ($returnType instanceof \ReflectionType) {
            $this->setReturnType($returnType, $methodStmt);
        }
        $methodInsideStatements = $this->getMethodInsideStatement($method);
        $methodStmt->addStmts($methodInsideStatements);

        return $this->addMethodDocComment($methodStmt, $method);
    }
1116363
public function getMethod()
    {
        if(!isset($this->_method) && isset($_SERVER['REQUEST_METHOD']))
        {
            $method = strtoupper($_SERVER['REQUEST_METHOD']);

            if($method == 'POST')
            {
                if($this->_headers->has('X-Http-Method-Override')) {
                    $method = strtoupper($this->_headers->get('X-Http-Method-Override'));
                }

                if($this->data->has('_method')) {
                    $method = strtoupper($this->data->get('_method', 'alpha'));
                }
            }

            $this->_method = $method;
        }

        return $this->_method;
    }
869419
final private function __setDataFromMethods()
    {
        // Get all public methods from class
        $this->methods = $this->class->getMethods(\ReflectionMethod::IS_PUBLIC);

        // Remove __contruct, __init, __finalize and this class methods from $this->methods
        $this->methods = array_filter($this->methods, function ($method) {
            return
                $method->class !== 'Sober\Controller\Controller' &&
                $method->name !== '__construct' &&
                $method->name !== '__before' &&
                $method->name !== '__after';
        });

        // Get all public static methods from class
        $this->staticMethods = $this->class->getMethods(\ReflectionMethod::IS_STATIC);

        // Remove $this->staticMethods from $this->methods using array_diff
        $this->dataMethods = array_diff($this->methods, $this->staticMethods);

        // Filter the remaining data methods
        $this->dataMethods = array_filter($this->dataMethods, function ($method) {
            return $method = $method->name;
        });

        // For each method convert method name to snake case and add to data[key => value]
        foreach ($this->dataMethods as $method) {
            // Convert method name to snake case
            $var = Utils::convertToSnakeCase($method->name);

            // Add var method name to data[]
            $this->data[$var] = $this->{$method->name}();
        }
    }
237171
private function getMethod()
    {
        if (is_array($this->handler) && 2 === sizeof($this->handler)) {
            return $this->handler[1];
        }

        if ($this->isStaticMethod()) {
            list (, $method) = explode('::', $this->handler);

            return $method;
        }

        return '';
    }
1206844
public function getMethods()
    {
        if (!$this->__methods) {
            $methods = array();
            $object  = $this->getObject();

            if (!($object instanceof AnObject)) {
                $reflection	= new ReflectionClass($object);
                foreach ($reflection->getMethods() as $method) {
                    $methods[] = $method->name;
                }
            } else {
                $methods = $object->getMethods();
            }

            $this->__methods = array_merge(parent::getMethods(), $methods);
        }

        return $this->__methods;
    }
733998
function createMethod() {
    if( !isset( $this->method ))
      return;
    switch( $this->format ) {
      case 'xcal':
        return ' method="'.$this->method.'"'.$this->nl;
        break;
      default:
        return 'METHOD:'.$this->method.$this->nl;
        break;
    }
  }
557829
public function getMethod()
    {
        if (null !== $this->method) {
            return $this->method;
        }

        // If the form was created from a button rather than the form node, check for HTML5 method override
        if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) {
            return strtoupper($this->button->getAttribute('formmethod'));
        }

        return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET';
    }
582063
public function getMethodNameGet()
    {
        $methodName = str_replace(' ', '', ucwords(str_replace(array(
            '_is_', '_has_', '_in_', '_',
        ), ' ', strtolower($this->getName(true)))));

        $type = $this->getType();

        switch (true) {
            case ($type instanceof Type\TypeBool) && stripos($this->getName(), '_has_') !== false:
                $methodPrefix = 'has';
                break;
            case ($type instanceof Type\TypeBool) && stripos($this->getName(), '_is_') !== false:
                $methodPrefix = 'is';
                break;
            case ($type instanceof Type\TypeBool) && stripos($this->getName(), '_in_') !== false:
                $methodPrefix = 'in';
                break;
            default:
                $methodPrefix = 'get';
                break;
        }

        return $methodPrefix . $methodName;
    }
294939
public function getMethod() 
    {
        $this->method || $this->method = strtoupper($this->getServer('REQUEST_METHOD'));
        
        return $this->method;
    }
589716
private function _return() {
    $node = new ReturnStatementNode();
    $this->mustMatch(T_RETURN, $node);
    if ($this->tryMatch(';', $node, NULL, TRUE, TRUE) || $this->currentType === T_CLOSE_TAG) {
      return $node;
    }
    $node->addChild($this->expr(), 'expression');
    $this->endStatement($node);
    return $node;
  }
227064
public function getMethods()
    {
        $behaviors = $this->getRepository()->getBehaviors();

        foreach ($behaviors as $behavior) {
            $this->mixin($behavior);
        }

        return parent::getMethods();
    }
564423
public function render()
    {
        $methodDocumentation = $this->buildMethodDocumentation($this->fullOriginalClassName, $this->methodName);
        $callParentMethodCode = $this->buildCallParentMethodCode($this->fullOriginalClassName, $this->methodName);

        $finalKeyword = $this->reflectionService->isMethodFinal($this->fullOriginalClassName, $this->methodName) ? 'final ' : '';
        $staticKeyword = $this->reflectionService->isMethodStatic($this->fullOriginalClassName, $this->methodName) ? 'static ' : '';

        $code = '';
        if ($this->addedPreParentCallCode !== '' || $this->addedPostParentCallCode !== '') {
            $argumentsCode = (count($this->reflectionService->getMethodParameters($this->fullOriginalClassName, $this->methodName)) > 0) ? '        $arguments = func_get_args();' . "\n" : '';
            $code = "\n" .
                $methodDocumentation .
                '    ' . $finalKeyword . $staticKeyword . "public function __construct()\n    {\n" .
                $argumentsCode .
                $this->addedPreParentCallCode . $callParentMethodCode . $this->addedPostParentCallCode .
                "    }\n";
        }
        return $code;
    }
96437
private function parseMethods()
    {
        $methods = $this->reflectionClass->getMethods(); // this still returns the methods for all parent classes
        if (!is_array($methods) || count($methods) < 1) {
            throw new RestException('Parser: The class "' . $this->class . '" doesn\'t have any methods defined.');
        }

        foreach ($methods as $m) {
            if ($m->isPublic()) {
                $methodParser = new MethodParser($this->parentClasses, $m, $this->normalize);
                $parsedMethod = $methodParser->parse();
                if ($parsedMethod) {
                    $this->parsedClass->addApiMethod($parsedMethod);
                }
            }
        }
    }
943916
private static function getCallerInfomation()
    {
        foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, self::STACK_FRAME_LIMIT) as $stack) {
            if (isset($stack['class']) && $stack['class'] !== __CLASS__) {
                $stack['function'] = (new \ReflectionMethod($stack['class'], $stack['function']))->name;
                return $stack;
            }
        }
        
        throw new \BadMethodCallException(sprintf('%s must use inside a method', __CLASS__));
    }
41913
private function MethodCall()
	{
		$values = [];

		if ( !$this->lexer->isNextToken( DocLexer::T_OPEN_PARENTHESIS ) )
			return $values;

		$this->match( DocLexer::T_OPEN_PARENTHESIS );

		if ( !$this->lexer->isNextToken( DocLexer::T_CLOSE_PARENTHESIS ) )
			$values = $this->Values();

		$this->match( DocLexer::T_CLOSE_PARENTHESIS );

		return $values;
	}
538371
public function getMethodDescription(): ?string
    {
        // Remove the comment markers
        $description = preg_replace('~\*/$~', '', $this->comment);
        $description = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $description);

        // Keep everything before the first annotation
        $description = trim(explode('@', $description)[0]);

        // Drop common "Get" or "Return" in front of comment
        $description = ucfirst(preg_replace('~^(set|get|return)s? ~i', '', $description));

        return $description ?: null;
    }
320598
public function method()
    {
        if (isset($this->parameters->post()['_method'])) {
            $method = strtoupper($this->parameters->post()['_method']);
            if (in_array($method, self::$allowedHackMethods)) {
                return $method;
            }
        }
        return $this->getParam('REQUEST_METHOD');
    }