private function checkOnlyRule(RuleInterface $rule, NodeInterface $node): ?Violation
    {
        $errors = array();

        foreach ($node->getTokens() as $token) {
            if (!$this->checkTokenForOnlyRule($rule, $token) &&
                !in_array($token, $errors)) {
                $errors[] = $token;
            }
        }

        if (count($errors)) {
            return new Violation($node, $rule, $errors, ViolationInterface::TYPE_ERROR);
        }

        return null;
    }