<commit_before><?php

if (count($argv) < 3) {
    echo "usage php create-admin.php username password";
    exit(1);
}

$username = $argv[1];
$password = $argv[2];

require __DIR__ . '/../app/config.php';
require __DIR__ . '/../app/constants.php';

require VENDOR . '/autoload.php';

$app = new \Athorrent\Application\WebApplication();

$user = new \Athorrent\Entity\User(null, $username);
$user->setRawPassword($password);
$user->save();<commit_msg>create-admin.php should add user role<commit_after><?php

if (count($argv) < 3) {
    echo "usage php create-admin.php username password";
    exit(1);
}

$username = $argv[1];
$password = $argv[2];

require __DIR__ . '/../app/config.php';
require __DIR__ . '/../app/constants.php';

require VENDOR . '/autoload.php';

$app = new \Athorrent\Application\WebApplication();

$user = new \Athorrent\Entity\User(null, $username);
$user->setRawPassword($password);
$user->save();

$userRole = new \Athorrent\Entity\UserRole($user->getUserId(), 'ROLE_ADMIN');
$userRole->save();
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 4.518918918918919, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4856100', 'n_tokens_mistral': 366, 'n_tokens_neox': 363, 'n_words': 74}