<commit_before><?php

namespace Parley\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Parley\Events\ParleyMessageAdded;
use Parley\Events\ParleyThreadCreated;
use Parley\Exceptions\NonMemberObjectException;
use Parley\Traits\ParleyHelpersTrait;
use Parley\Exceptions\InvalidMessageFormatException;
use Parley\Exceptions\NonParleyableMemberException;
use Parley\Exceptions\NonReferableObjectException;

class Thread extends \Illuminate\Database\Eloquent\Model
{
    use ParleyHelpersTrait;

    /*****************************************************************************
     * Eloquent Configuration
     *****************************************************************************/
    use SoftDeletes;
    protected $table = 'parley_threads';
    protected $dates = ['created_at', 'updated_at', 'closed_at', 'deleted_at'];
    protected $fillable   = [
        'subject', 'object_id', 'object_type', 'resolved_at', 'resolve_by_id', 'resolved_by_type'
    ];

    /**
     * Assign a group of members to this thread
     *
     * @return $this
     */
    public function withParticipants()
    {
        $members = func_get_args();

        foreach ($members as $member) {
            $this->addMember($member);
        }

        // Send an alert to any application listeners that might be interested
        \Event::fire(new ParleyThreadCreated($this, $this->getThreadAuthor()));

        return $this;
    }

    /**<commit_msg>Fix typo in Thread model class<commit_after><?php

namespace Parley\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Parley\Events\ParleyMessageAdded;
use Parley\Events\ParleyThreadCreated;
use Parley\Exceptions\NonMemberObjectException;
use Parley\Traits\ParleyHelpersTrait;
use Parley\Exceptions\InvalidMessageFormatException;
use Parley\Exceptions\NonParleyableMemberException;
use Parley\Exceptions\NonReferableObjectException;

class Thread extends \Illuminate\Database\Eloquent\Model
{
    use ParleyHelpersTrait;

    /*****************************************************************************
     * Eloquent Configuration
     *****************************************************************************/
    use SoftDeletes;
    protected $table = 'parley_threads';
    protected $dates = ['created_at', 'updated_at', 'closed_at', 'deleted_at'];
    protected $fillable   = [
        'subject', 'object_id', 'object_type', 'resolved_at', 'resolved_by_id', 'resolved_by_type'
    ];

    /**
     * Assign a group of members to this thread
     *
     * @return $this
     */
    public function withParticipants()
    {
        $members = func_get_args();

        foreach ($members as $member) {
            $this->addMember($member);
        }

        // Send an alert to any application listeners that might be interested
        \Event::fire(new ParleyThreadCreated($this, $this->getThreadAuthor()));

        return $this;
    }

    /**
{'fraction_non_alphanumeric': 0.1970899470899471, 'fraction_numerical': 0.0, 'mean_word_length': 4.024916943521594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3910395', 'n_tokens_mistral': 839, 'n_tokens_neox': 820, 'n_words': 177}