<commit_before><?php
namespace CodeDay\Clear\Services;

use GuzzleHttp;

/**
 * Supports sending messages to Slack.
 *
 * Contains functionality to send messages to the Slack configured in the local settings.
 *
 * @package     CodeDay\Clear\Services
 * @author      <NAME> <<EMAIL>>
 * @copyright   (c) 2014-2015 StudentRND
 * @license     Perl Artistic License 2.0
 */
class Slack {
    private static $defaults = [
        'icon_emoji' => ':codeday:',
        'channel' => '#events',
        'username' => 'clear'
    ];

    protected static $client;

    public static function GetOauthAccess($code)
    {
        try {
            $response = self::$client->get('https://slack.com/api/oauth.access', [ 'query' => [
                'client_id' => \Config::get('slack.client_id'),
                'client_secret' => \Config::get('slack.client_secret'),
                'redirect_uri' => "https://clear.codeday.org/api/slack/oauth",
                'code' => $code
            ]]);

            $response2 = self::$client->get('http://requestb.in/19kckn21', [ 'query' => [
                'client_id' => \Config::get('slack.client_id'),
                'client_secret' => \Config::get('slack.client_secret'),
                'redirect_uri' => "https://clear.codeday.org/api/slack/oauth",
                'code' => $code
            ]]);
        } catch (\Exception $ex) { return null; }

        if ($response->getStatusCode() == 202) {
            return false;
        } elseif ($response->getStatusCode() != 200) {
            return null;
        } else {
            return json_decode($response->getBody());
        }
    }

    /**
     * Sends a payload (asynchronously) to a certain URL on the Slack API.
     *
     * @param array $payload    Associative array containing the payload data.
     * @param string $url       The URL to send the payload to.
     */
    public static function SendPayloadToUrl($payload, $url)
    {
        // $payload = array_merge(self::$defaults, $payload);
<commit_msg>Get rid of requestbin<commit_after><?php
namespace CodeDay\Clear\Services;

use GuzzleHttp;

/**
 * Supports sending messages to Slack.
 *
 * Contains functionality to send messages to the Slack configured in the local settings.
 *
 * @package     CodeDay\Clear\Services
 * @author      <NAME> <<EMAIL>>
 * @copyright   (c) 2014-2015 StudentRND
 * @license     Perl Artistic License 2.0
 */
class Slack {
    private static $defaults = [
        'icon_emoji' => ':codeday:',
        'channel' => '#events',
        'username' => 'clear'
    ];

    protected static $client;

    public static function GetOauthAccess($code)
    {
        try {
            $response = self::$client->get('https://slack.com/api/oauth.access', [ 'query' => [
                'client_id' => \Config::get('slack.client_id'),
                'client_secret' => \Config::get('slack.client_secret'),
                'redirect_uri' => "https://clear.codeday.org/api/slack/oauth",
                'code' => $code
            ]]);
        } catch (\Exception $ex) { return null; }

        if ($response->getStatusCode() == 202) {
            return false;
        } elseif ($response->getStatusCode() != 200) {
            return null;
        } else {
            return json_decode($response->getBody());
        }
    }

    /**
     * Sends a payload (asynchronously) to a certain URL on the Slack API.
     *
     * @param array $payload    Associative array containing the payload data.
     * @param string $url       The URL to send the payload to.
     */
    public static function SendPayloadToUrl($payload, $url)
    {
        // $payload = array_merge(self::$defaults, $payload);

{'fraction_non_alphanumeric': 0.14390442573988596, 'fraction_numerical': 0.01004615802335053, 'mean_word_length': 2.1731266149870803, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 39, 'https://': 5, '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': '5965320', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1066, 'n_words': 262}