<commit_before><?php

namespace Visitmedia\FindologicClient;

use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;

class FindologicClient
{

    private $client;
    private $domain;
    private $shopKey;

    const ACTION_SEARCH = 'index';
    const ACTION_ISALIVE = 'alivetest';

    public function __construct(ClientInterface $client, $domain, $shopKey)
    {
        $this->client = $client;
        $this->domain = $domain;
        $this->shopKey = $shopKey;
    }

    /**
     * @throws RequestException
     * @return bool
     */
    public function isAlive()
    {
        $response = $this->client->get($this->createRequestUrl(static::ACTION_ISALIVE) . '?shopkey=' . $this->shopKey);
        return $response->getBody() === 'alive';
    }

    /**
     * @throws RequestException
     * @param SearchRequest $searchRequest
     * @return SearchResult
     */
    public function sendSearchRequest(SearchRequest $searchRequest)
    {<commit_msg>fixed missing toString conversion for isAlive test<commit_after><?php

namespace Visitmedia\FindologicClient;

use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\RequestException;

class FindologicClient
{

    private $client;
    private $domain;
    private $shopKey;

    const ACTION_SEARCH = 'index';
    const ACTION_ISALIVE = 'alivetest';

    public function __construct(ClientInterface $client, $domain, $shopKey)
    {
        $this->client = $client;
        $this->domain = $domain;
        $this->shopKey = $shopKey;
    }

    /**
     * @throws RequestException
     * @return bool
     */
    public function isAlive()
    {
        $response = $this->client->get($this->createRequestUrl(static::ACTION_ISALIVE) . '?shopkey=' . $this->shopKey);
        return (string)$response->getBody() === 'alive';
    }

    /**
     * @throws RequestException
     * @param SearchRequest $searchRequest
     * @return SearchResult
     */
    public function sendSearchRequest(SearchRequest $searchRequest)
    {
{'fraction_non_alphanumeric': 0.12081877184223665, 'fraction_numerical': 0.0, 'mean_word_length': 3.0814663951120163, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2453788', 'n_tokens_mistral': 595, 'n_tokens_neox': 579, 'n_words': 122}