private function isValidDirective($directive, $message1, $message2)
    {
        if (!$this->checker->setString($directive)->getString()) {
            throw ServerException::forInvalidMatcher(
                $directive,
                $message1
            );
        }

        if (!$this->checker->hasKeyAndValueSubPattern()) {
            throw ServerException::forInvalidMatcher(
                $directive,
                $message2
            );
        }

        return true;
    }