protected function getVariables(TokenInterface $token, $subject)
    {
        $event = new GetExpressionVariablesEvent($token);
        $this->dispatcher->dispatch(ExpressionVariableEvents::GET, $event);

        $variables = array_merge($event->getVariables(), [
            'object' => $subject,
            'subject' => $subject,
        ]);

        if ($subject instanceof Request) {
            $variables['request'] = $subject;
        }

        return $variables;
    }