private function invokeActionMethod(\ReflectionMethod $actionMethod, array $parameters)
    {
        $this->actionMethod = $actionMethod;

        // Handle pre-action event.
        $preActionResult = $this->isPreActionEventEnabled() ? $this->onPreActionEvent() : null;
        if ($preActionResult !== null) {
            return $preActionResult;
        }

        // Handle action method.
        $result = $actionMethod->invokeArgs($this, $parameters);

        // Handle post-action event.
        $postActionResult = $this->isPostActionEventEnabled() ? $this->onPostActionEvent() : null;
        if ($postActionResult !== null) {
            return $postActionResult;
        }

        return $result;
    }