<commit_before><?php
namespace Mpociot\SlackBot;

use Cache;
use Closure;
use Frlnc\Slack\Core\Commander;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use SuperClosure\Serializer;

/**
 * Class SlackBot
 * @package Mpociot\SlackBot
 */
class SlackBot
{

    /**
     * @var \Symfony\Component\HttpFoundation\ParameterBag
     */
    public $payload;

    /**
     * @var \Illuminate\Support\Collection
     */
    protected $event;

    /**
     * @var Commander
     */
    protected $commander;

    /**
     * @var Serializer
     */
    protected $serializer;

    /**
     * @var string
     */
    protected $token;

    /**
     * @var array
     */
    protected $matches = [];

    /**
     * Slack constructor.
     * @param Serializer $serializer
     * @param Commander $commander
     * @param Request $request
     */
    public function __construct(Serializer $serializer, Commander $commander, Request $request)
    {
        if ($request->has('payload')) {
            $this->payload = collect(json_decode($request->get('payload'), true));
            $this->event   = collect();
        } else {
            $this->payload = $request->json();
            $this->event   = collect($this->payload->get('event'));
        }

        $this->serializer = $serializer;
        $this->commander = $commander;
        $this->request = $request;
    }

    /**
     * @param string $token<commit_msg>Don't store request<commit_after><?php
namespace Mpociot\SlackBot;

use Cache;
use Closure;
use Frlnc\Slack\Core\Commander;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use SuperClosure\Serializer;

/**
 * Class SlackBot
 * @package Mpociot\SlackBot
 */
class SlackBot
{

    /**
     * @var \Symfony\Component\HttpFoundation\ParameterBag
     */
    public $payload;

    /**
     * @var \Illuminate\Support\Collection
     */
    protected $event;

    /**
     * @var Commander
     */
    protected $commander;

    /**
     * @var Serializer
     */
    protected $serializer;

    /**
     * @var string
     */
    protected $token;

    /**
     * @var array
     */
    protected $matches = [];

    /**
     * Slack constructor.
     * @param Serializer $serializer
     * @param Commander $commander
     * @param Request $request
     */
    public function __construct(Serializer $serializer, Commander $commander, Request $request)
    {
        if ($request->has('payload')) {
            $this->payload = collect(json_decode($request->get('payload'), true));
            $this->event   = collect();
        } else {
            $this->payload = $request->json();
            $this->event   = collect($this->payload->get('event'));
        }

        $this->serializer = $serializer;
        $this->commander = $commander;
    }

    /**
     * @param string $token
{'fraction_non_alphanumeric': 0.14247221286628495, 'fraction_numerical': 0.0, 'mean_word_length': 2.274531422271224, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '4492336', 'n_tokens_mistral': 889, 'n_tokens_neox': 887, 'n_words': 177}