protected function tryInvokeActionMethod(string $action, array $parameters, bool $isCaseSensitive, &$result, ?bool &$hasFoundActionMethod = null): bool
    {
        $reflectionClass = new \ReflectionClass($this);

        $actionMethod = self::findActionMethod($reflectionClass, $action, $isCaseSensitive);
        if ($actionMethod === null) {
            // Suitable action method not found.
            $hasFoundActionMethod = false;

            return false;
        }

        $hasFoundActionMethod = true;

        if (!self::actionMethodMatchesParameters($actionMethod, $parameters)) {
            // Action method found, but parameters did not match.
            return false;
        }

        $result = $this->invokeActionMethod($actionMethod, $parameters);

        return true;
    }