Returns a method by name, if it exists.

@param string $name
The method name.

@return InterfaceMethodNode|NULL
434974
public function getMethod($name) {
    $methods = $this
      ->getMethods()
      ->filter(function (InterfaceMethodNode $method) use ($name) {
        return $method->getName()->getText() === $name;
      });
    return $methods->isEmpty() ? NULL : $methods[0];
  }
873205
public static function getHandlerByName($name)
    {
        return isset(self::$namedRoutes[$name]) ? self::$namedRoutes[$name][1] : null;
    }
684977
public function parameter(string $name): ?string
    {
        if (isset($this->parameters[$name])) {
            return $this->parameters[$name];
        }

        return null;
    }
1260507
public function getIndexByName($name)
    {
        return isset($this->indexes[$name]) ? $this->indexes[$name] : null;
    }
868429
public function getByName($name)
	{
		return isset($this->nameList[$name]) ? $this->nameList[$name] : null;
	}
448036
public function findActionByName(string $name)
    {
        foreach ($this->actions as $action) {
            if ($action->getAction() === $name) {
                return $action;
            }
        }

        return null;
    }
195298
private function getGetter($source, string $name): ?ReflectionMethod
    {
        if (!preg_match('~^(is|has)[A-Z]~', $name)) {
            $name = 'get' . ucfirst($name);
        }

        $class = new ReflectionClass($source);
        if ($class->hasMethod($name)) {
            $method = $class->getMethod($name);
            if ($method->getModifiers() & ReflectionMethod::IS_PUBLIC) {
                return $method;
            }
        }

        return null;
    }
97685
public function get($name)
    {
        $found = null;
        /** @var ElementInterface $element */
        foreach ($this->elements as $element) {
            if ($element->getName() == $name) {
                $found = $element;
            }
        }
        return $found;
    }
950682
public function getByName($name)
    {
        return isset($this->names[$name]) ? $this->names[$name] : null;
    }
383725
public function get(string $name)
    {
        if (!array_key_exists($name, $this->headers)) {
            return null;
        }

        return $this->headers[$name];
    }
1086665
public function getParameterByName($name)
    {
        foreach ($this->parameters as $parameter) {
            if ($parameter->getName() === $name) {
                return $parameter;
            }
        }

        return null;
    }
793729
public function getArgumentByName(string $name)
    {
        $param = self::$params[$this->className][$this->method];

        if (!isset($param[$name])) {
            return null;
        }

        return $this->arguments[$param[$name]['index']];
    }
1061646
public function get($name)
    {
        if (! $this->has($name)) return null;

        $def = $this->components[$name];

        // already initialized.
        if (! $def instanceof ComponentDefine) {
            return $def;
        }

        // initialize.
        return $def->getInstance();
    }
106288
public static function get($name)
    {
        $name = ltrim($name, '\\');
        if (!$data = self::getInternal($name)) {
            return null;
        }

        return $data;
    }
381199
public function get(string $name)
    {
        return isset(self::$services[$name]) ? self::$services[$name] : null;
    }
1060396
protected function findPaymentMethodMapperByName($name)
    {
        if (array_key_exists($name, $this->registeredMethodMappers)) {
            return $this->registeredMethodMappers[$name];
        }

        return null;
    }
758647
public function getParameter($name): ?Parameter
    {
        /** @var Parameter $parameter */
        foreach ($this->parameters as $parameter) {
            if ($parameter->getKey() === $name) {
                return $parameter;
            }
        }

        return null;
    }