public function isValid($value, $context = null): bool
    {
        if (!is_array($context)) {
            $this->error(self::INVALID);
            return false;
        }

        if (!in_array($this->getCommentType(), $this->validCommentTypes)) {
            $this->error(self::INVALID_COMMENT_TYPE);
            return false;
        }

        $this->setValue($value);

        $akismet = new AkismetService($this->getApiKey(), $this->getBlog());

        if (!$akismet->verifyKey($this->getApiKey())) {
            throw new Exception\InvalidArgumentException('Invalid API key for Akismet');
        }

        $data = [
            'comment_type'          => $this->getCommentType(),
            'comment_author'        => $context[$this->getCommentAuthor()],
            'comment_author_email'  => $context[$this->getCommentAuthorEmail()],
            'comment_author_url'    => $context[$this->getCommentAuthorUrl()] ?? '',
            'comment_content'       => $value,
            'user_agent'            => $this->getUserAgent(),
            'user_ip'               => $this->getUserIp(),
        ];

        if ($akismet->isSpam($data)) {
            $this->error(self::SPAM);
            return false;
        }

        return true;
    }