<commit_before><?php

namespace App\Console\Commands;

use App\Models\Application;
use App\Models\User;
use Illuminate\Console\Command;

class GenerateEmailTodo extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'users:generateemails';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->info("MODES:");
        $this->info("1: no decision -> accept");
        $this->info("2: no decision -> waitlist");
        $this->info("3: waitlist -> accept");
        $this->info("4: accept -> expired");
        $this->info("5: incomplete apps");
        $mode = $this->ask('mode?');
        $this->info("mode: ".$mode);

        $toAcceptFromNull = Application::whereNull('emailed_decision')
                    ->where('decision',Application::DECISION_ACCEPT)
                    ->get()->lists('user_id');
        $toWaitlistFromNull = Application::whereNull('emailed_decision')
                    ->where('decision',Application::DECISION_WAITLIST)
                    ->get()->lists('user_id');
        $toAcceptFromWaitlist = Application::where('emailed_decision',Application::DECISION_WAITLIST)
                    ->where('decision',Application::DECISION_ACCEPT)
                    ->get()->lists('user_id');
        $expiredFromAccepted = Application::where('emailed_decision',Application::DECISION_ACCEPT)
                    ->where('decision',Application::DECISION_EXPIRED)
                    ->get()->lists('user_id');

        $incomplete = Application::where('completed_calculated',false)->get()->lists('user_id');


        if($mode==1)
            foreach(User::whereIn('id',$toAcceptFromNull)->get() as $u)
                $this->info($u->email." ".$u->first_name);
        if($mode==2)
            foreach(User::whereIn('id',$toWaitlistFromNull)->get() as $u)
                $this->info($u->email." ".$u->first_name);
        if($mode==3)
            foreach(User::whereIn('id',$toAcceptFromWaitlist)->get() as $u)
                $this->info($u->email." ".$u->first_name);
        if($mode==4)
            foreach(User::whereIn('id',$expiredFromAccepted)->get() as $u)
                $this->info($u->email." ".$u->first_name);
        if($mode==5)
            foreach(User::whereIn('id',$incomplete)->get() as $u)
                $this->info($u->email);

    }
}<commit_msg>Apply fixes from StyleCI<commit_after><?php

namespace App\Console\Commands;

use App\Models\User;
use App\Models\Application;
use Illuminate\Console\Command;

class GenerateEmailTodo extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'users:generateemails';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->info('MODES:');
        $this->info('1: no decision -> accept');
        $this->info('2: no decision -> waitlist');
        $this->info('3: waitlist -> accept');
        $this->info('4: accept -> expired');
        $this->info('5: incomplete apps');
        $mode = $this->ask('mode?');
        $this->info('mode: '.$mode);

        $toAcceptFromNull = Application::whereNull('emailed_decision')
                    ->where('decision', Application::DECISION_ACCEPT)
                    ->get()->lists('user_id');
        $toWaitlistFromNull = Application::whereNull('emailed_decision')
                    ->where('decision', Application::DECISION_WAITLIST)
                    ->get()->lists('user_id');
        $toAcceptFromWaitlist = Application::where('emailed_decision', Application::DECISION_WAITLIST)
                    ->where('decision', Application::DECISION_ACCEPT)
                    ->get()->lists('user_id');
        $expiredFromAccepted = Application::where('emailed_decision', Application::DECISION_ACCEPT)
                    ->where('decision', Application::DECISION_EXPIRED)
                    ->get()->lists('user_id');

        $incomplete = Application::where('completed_calculated', false)->get()->lists('user_id');

        if ($mode == 1) {
            foreach (User::whereIn('id', $toAcceptFromNull)->get() as $u) {
                $this->info($u->email.' '.$u->first_name);
            }
        }
        if ($mode == 2) {
            foreach (User::whereIn('id', $toWaitlistFromNull)->get() as $u) {
                $this->info($u->email.' '.$u->first_name);
            }
        }
        if ($mode == 3) {
            foreach (User::whereIn('id', $toAcceptFromWaitlist)->get() as $u) {
                $this->info($u->email.' '.$u->first_name);
            }
        }
        if ($mode == 4) {
            foreach (User::whereIn('id', $expiredFromAccepted)->get() as $u) {
                $this->info($u->email.' '.$u->first_name);
            }
        }
        if ($mode == 5) {
            foreach (User::whereIn('id', $incomplete)->get() as $u) {
                $this->info($u->email);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.17167985927880386, 'fraction_numerical': 0.003518029903254178, 'mean_word_length': 2.144911504424779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 93, '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': '812316', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1601, 'n_words': 280}