<commit_before><?php

namespace Badger\GameBundle\Notifier;

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

/**
 * Slack implementation of the NotifierInterface.
 * It makes a CURL call to the slack api to send a message to a given channel.
 *
 * @author <NAME> <<EMAIL>>
 */
class SlackNotifier implements NotifierInterface
{
    /** @var string */
    private $webhookUrl;

    /**
     * @param string $webhookUrl
     */
    public function __construct($webhookUrl)
    {
        $this->webhookUrl = $webhookUrl;
    }

    /**
     * @param mixed $data
     */
    public function notify($data)
    {
        $client = new Client();
        $request = new Request(
            'POST',
            $this->webhookUrl,
            ['Content-type' => 'application/json'],
            json_encode($data)
        );

        $response = $client->send($request, ['timeout' => 2]);
    }
}<commit_msg>Notify slack asynchronously & don't catch the error<commit_after><?php

namespace Badger\GameBundle\Notifier;

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

/**
 * Slack implementation of the NotifierInterface.
 * It makes a CURL call to the slack api to send a message to a given channel.
 *
 * @author <NAME> <<EMAIL>>
 */
class SlackNotifier implements NotifierInterface
{
    /** @var string */
    private $webhookUrl;

    /**
     * @param string $webhookUrl
     */
    public function __construct($webhookUrl)
    {
        $this->webhookUrl = $webhookUrl;
    }

    /**
     * @param mixed $data
     */
    public function notify($data)
    {
        $client = new Client();
        $request = new Request(
            'POST',
            $this->webhookUrl,
            ['Content-type' => 'application/json'],
            json_encode($data)
        );

        $client->sendAsync($request, ['timeout' => 2]);
    }
}
{'fraction_non_alphanumeric': 0.13050570962479607, 'fraction_numerical': 0.002175095160413268, 'mean_word_length': 2.32129963898917, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6338479', 'n_tokens_mistral': 561, 'n_tokens_neox': 542, 'n_words': 143}