Returns the declared return type of a method (for PHP < 7.0 this will always return null)

@param string $className
@param string $methodName
@return string The declared return type of the method or null if none was declared
1705
public function getMethodDeclaredReturnType($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE])) {
            return null;
        }

        return $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE];
    }
540327
public function HasNewMethod($ClassName, $MethodName) {
      $Key = strtolower($ClassName.'_'.$MethodName.'_Create');
      if (array_key_exists($Key, $this->_NewMethodCollection)) {
         $Result = explode('.', $this->_NewMethodCollection[$Key]);
         return $Result[0];
      } else {
         return FALSE;
      }
   }
1051485
private function parseMethodWithoutAnnotation(string $className, string $methodName)
    {
        $parser = new MethodWithoutAnnotationParser($this->annotationResource);
        $parser->parser($className, null, "", $methodName);
    }
193918
protected static function isAjaxMethod($methodName)
    {
        $suffixLength = strlen(self::AJAX_METHOD_NAME_SUFFIX);

        return strlen($methodName) > $suffixLength
            && self::AJAX_METHOD_NAME_SUFFIX === substr($methodName, -1 * $suffixLength);
    }
1350995
public static PHPMethodDescriptor findMethod(PHPClassDescriptor desc, String methodName) {
		PHPMethodDescriptor meth;
		meth = desc.getMethod(Helper.formatProcedureName(methodName));
		if (meth != null) {
			return meth;
		}
		meth = desc.getMethod("get" + Helper.formatProcedureName(methodName));
		if (meth != null) {
			return meth;
		}
		return null;
	}
577794
public function autoDetectModuleNameByClassName($className)
    {
        if (array_key_exists($className, $this->classNameToModuleName)) {
            $resultModuleName =  $this->classNameToModuleName[$className];
        } else {
            $index = $this->getModulesIndex();
            $classNameLength = strlen($className);

            $resultModuleName = null;
            foreach ($index as $moduleName => $moduleNameLength) {
                if ($classNameLength > $moduleNameLength && 0 === strrpos($className, $moduleName)) {
                    $resultModuleName = $moduleName;
                    break;
                }
            }
            $this->classNameToModuleName[$className] = $resultModuleName;
        }

        return $resultModuleName;
    }
751301
protected function getType($context, $methodName, Node $node = null)
    {
        if ($this->isController($context)) {
            switch ($methodName) {
                case 'getDoctrine':
                    return 'Doctrine\Bundle\DoctrineBundle\Registry';
                case 'createForm':
                    return 'Symfony\Component\Form\Form';
                case 'createFormBuilder':
                    return 'Symfony\Component\Form\FormBuilder';
            }
        }

        if ('get' === $methodName && ($this->isController($context) || self::CONTAINER == $context)) {
            if ($node instanceof Node && isset($node->var)
                && ($node->var->name == 'this' || $node->var->name == 'container')
            ) {
                if ($node->args[0]->value instanceof Node\Scalar\String_) {
                    $serviceId = $node->args[0]->value->value;
                } elseif ($node->args[0]->value instanceof Node\Expr\Variable) {
                    // TODO: resolve variables
                }

                if (isset($serviceId) && $this->container->has($serviceId)) {
                    return $this->container->get($serviceId);
                }
            }

            return;
        }

        return;
    }
917318
public function hasMethod($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName]);
    }
1030665
public function nextSpec($methodName)
    {
        if ($this->pointer >= count($this->chain)) {
            throw new \PHPUnit_Framework_AssertionFailedError("There are no more method calls expected given assigned ordering");
        }
        if ($this->pointer + 1 < count($this->chain)) {
            $next = $this->chain[$this->pointer + 1];
            if ($next[0] === $methodName) {
                // if the next method has the same name as the passed
                // $methodName, then advance the pointer and return the
                // given spec.
                $this->pointer++;

                return $next[1];
            }
        }

        if ($this->pointer === -1) {
            throw new \PHPUnit_Framework_AssertionFailedError(sprintf("Unexpected method invocation %s at call index %s, haven't seen any method calls yet", $methodName, $this->pointer, true));
        }
        $current = $this->chain[$this->pointer];
        if ($current[0] !== $methodName) {
            // if the current spec does not match the method name,
            // we do not have any other possible specs to return
            // so we throw an assertion failure with a print of every
            // method we've run so far:
            $methodsSoFar = [];
            for ($i = 0; $i <= $this->pointer; $i++) {
                $methodsSoFar[] = $this->chain[$i][0];
            }

            throw new \PHPUnit_Framework_AssertionFailedError(sprintf("Unexpected method invocation %s at call index %s, seen method calls so far: %s", $methodName, $this->pointer, print_r(implode($methodsSoFar, "\n"), true)));
        }

        return $current[1];
    }
2742
protected function usedClass(ClassName $className)
    {
        foreach ($this->usedClasses() as $tuple) {
            list($usedClass, $as) = $tuple;
            if ($this->comparator()->equals($as, $className)) {
                return $usedClass;
            }
        }

        return null;
    }
810089
private function getBindParams(string $className, string $methodName, \Throwable $throwable)
    {
        $reflectClass  = new \ReflectionClass($className);
        $reflectMethod = $reflectClass->getMethod($methodName);
        $reflectParams = $reflectMethod->getParameters();
        $response      = RequestContext::getResponse();
        $request       = RequestContext::getRequest();

        // binding params
        $bindParams = [];
        foreach ($reflectParams as $key => $reflectParam) {
            $reflectType = $reflectParam->getType();

            // undefined type of the param
            if ($reflectType === null) {
                $bindParams[$key] = null;
                continue;
            }

            /**
             * defined type of the param
             * @notice \ReflectType::getName() is not supported in PHP 7.0, that is why use __toString()
             */
            $type = $reflectType->__toString();
            if ($type === Request::class) {
                $bindParams[$key] = $request;
            } elseif ($type == Response::class) {
                $bindParams[$key] = $response;
            } elseif ($type == \Throwable::class) {
                $bindParams[$key] = $throwable;
            } else {
                $bindParams[$key] = null;
            }
        }

        return $bindParams;
    }
576231
public function create(string $className, string $typeName): Type
    {
        $type = clone $this->types->getInput($className);
        $fieldsGetter = $type->config['fields'];

        $optionalFieldsGetter = function () use ($fieldsGetter): array {
            $optionalFields = [];
            foreach ($fieldsGetter() as $field) {
                if ($field['type'] instanceof NonNull) {
                    $field['type'] = $field['type']->getWrappedType();
                }

                unset($field['defaultValue']);

                $optionalFields[] = $field;
            }

            return $optionalFields;
        };
        $type->config['fields'] = $optionalFieldsGetter;
        $type->name = $typeName;

        return $type;
    }
929430
function &methodNamed($methodName)
    {
        $return = NULL;
        if (isset($this->_methods[$methodName])) {
            $return =& $this->_methods[$methodName];
        }

        return $return;
    }
990009
public function matchesMethod($className, $methodName): bool
    {
        $this->initialize();

        $methodIdentifier = strtolower($className . '->' . $methodName);
        if (isset(static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()])) {
            return true;
        }

        return false;
    }
1264539
protected function getMethodReflection($className, $methodName)
    {
        $this->dataCacheNeedsUpdate = true;
        if (!isset($this->methodReflections[$className][$methodName])) {
            $this->methodReflections[$className][$methodName] = new MethodReflection($className, $methodName);
        }
        return $this->methodReflections[$className][$methodName];
    }
329239
public function getMethod($classname, $method)
    {
        return $this->hasMethod($classname, $method)
            ? $this->methods[$classname . '::' . $method]
            : [];
    }
1316124
private function getViaFactory(string $className, string $typeName, AbstractTypeFactory $factory): Type
    {
        $this->throwIfNotEntity($className);

        if (!isset($this->types[$typeName])) {
            $instance = $factory->create($className, $typeName);
            $this->registerInstance($instance);
        }

        return $this->types[$typeName];
    }