<commit_before><?php

namespace Stevebauman\Maintenance\Commands;

use Stevebauman\Maintenance\Services\SentryService;
use Illuminate\Console\Command;

class CreateAdminCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'maintenance:create-admin';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Creates a superuser for the maintenance application';

    /**
     * The Sentry service for creating a new user.
     *
     * @var SentryService
     */
    protected $sentry;

    /**
     * @param SentryService $sentry
     */
    public function __construct(SentryService $sentry)
    {
        $this->sentry = $sentry;

        parent::__construct();
    }

    /**
     * Execute the command.
     */
    public function fire()
    {
        $user = [
            'first_name' => $this->askFirstName(),
            'last_name' => $this->askLastName(),
            'email' => $this->askEmail(),
            'username' => $this->askUsername(),
            'password' => $this->askPassword(),
            'permissions' => ['superuser' => 1],
        ];

        $newUser = $this->sentry->createUser($user);

        if ($newUser) {
            $this->info('Successfully created user');
        } else {
            $this->error('There was an error trying to create a user, please try again.');
        }
    }

    /**
     * Ask for the administrators first name.
     *
     * @return string
     */
    private function askFirstName()
    {
        return $this->ask('What will you use as the administrators first name? ');
    }

    /**
     * Ask for the administrators last name.
     *
     * @return string
     */
    private function askLastName()<commit_msg>Fixed administrators not being activated from command<commit_after><?php

namespace Stevebauman\Maintenance\Commands;

use Stevebauman\Maintenance\Services\SentryService;
use Illuminate\Console\Command;

class CreateAdminCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'maintenance:create-admin';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Creates a superuser for the maintenance application';

    /**
     * The Sentry service for creating a new user.
     *
     * @var SentryService
     */
    protected $sentry;

    /**
     * @param SentryService $sentry
     */
    public function __construct(SentryService $sentry)
    {
        $this->sentry = $sentry;

        parent::__construct();
    }

    /**
     * Execute the command.
     */
    public function fire()
    {
        $user = [
            'first_name' => $this->askFirstName(),
            'last_name' => $this->askLastName(),
            'email' => $this->askEmail(),
            'username' => $this->askUsername(),
            'password' => $this->askPassword(),
            'activated' => true,
            'permissions' => ['superuser' => 1],
        ];

        $newUser = $this->sentry->createUser($user);

        if ($newUser) {
            $this->info('Successfully created user');
        } else {
            $this->error('There was an error trying to create a user, please try again.');
        }
    }

    /**
     * Ask for the administrators first name.
     *
     * @return string
     */
    private function askFirstName()
    {
        return $this->ask('What will you use as the administrators first name? ');
    }

    /**
     * Ask for the administrators last name.
     *
     * @return string
     */
    private function askLastName()
{'fraction_non_alphanumeric': 0.12720368863574721, 'fraction_numerical': 0.0005424464334147003, 'mean_word_length': 1.9935064935064934, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '2558567', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1020, 'n_words': 265}